Having an issue with a small project and I've been stuck for the past 3 days... I have to convert data cells on a left column of a table in a html file into links (that will target other html files) using javascript & jquery in a separate js file. I am not able to edit the html file due to restrictions on the question.
I hope I understood your question correctly. You could access the cells with the selector .code and then use append() to put a link in there like so:
$(".code").each(function(i){ //find the right cells and for each one...
var text = $(this).text(); //...read the contents...
text = text.substring(3); //...remove the first 3 letters...
$(this).text(""); //...remove the text...
$(this).append("<a href='"+text+".html'>"+text+"</a>"); //...and replace with a link
});
Example: http://jsfiddle.net/7fawbkck/2/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With