What the difference between text() and html() functions in jQuery ?

$("#div").html('<a href="https://stackoverflow.com/questions/1910794/example.html">Link</a><b>hello</b>');

vs

$("#div").text('<a href="https://stackoverflow.com/questions/1910794/example.html">Link</a><b>hello</b>');

17 Answers
17

Tags:

Leave a Reply

Your email address will not be published. Required fields are marked *