What the difference between text() and html() functions in jQuery ?
$(\"#div\").html(\'Linkhello\
The different is .html()
evaluate as a html, .text()
avaluate as a text.
Consider a block of html
HTML
JS
var out1 = $('#mydiv').html();
var out2 = $('#mydiv').text();
console.log(out1) // This output all the html tag
console.log(out2) // This is output just the text 'This is a div container Link 1 Link 2 a text after ul'
The illustration is from this link http://api.jquery.com/text/