jquery .html() vs .append()

Posted by Argiropoulos Stavros on Stack Overflow See other posts from Stack Overflow or by Argiropoulos Stavros
Published on 2010-06-10T14:29:04Z Indexed on 2010/06/11 6:53 UTC
Read the original article Hit count: 265

Filed under:
|

Hello

Lets say I have an empty div:

<div id='myDiv'></div>

Is this:

$('#myDiv').html("<div id='mySecondDiv'></div>");

The same as:

var mySecondDiv=$('<div></div>');
$('myDiv').append(mySecondDiv);

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about html