I've been working on trying to style the html CODE element by adding an ordered list on top of its content and then a a LI and a P before each new line, with their closing tags added to the end of each line.
This is what I have:
var oldcontent = $(this).html();
$(this).html("" + oldcontent + "");
var lines = oldcontent.split(/[\n\r]/g);
" + lines + "
This simply doesn't work. I get no errors, I don't know what is wrong.
Does anybody know how to fix this?
以上就是Jquery - Adding html before each new line in an array的详细内容，更多请关注web前端其它相关文章！