Tutorial :adding html with jquery



Question:

is there a neat way to add html with jQuery instead of

$("#elm").html($("#elm").html() + "some text");  

It'd be great to just do $("#elm").html(+= "some text") or something similar...


Solution:1

$('#elm').append('some text');  

http://docs.jquery.com/Manipulation/append for more information on using append


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »