jQuery insert element and overwrite

Posted by fire on Stack Overflow See other posts from Stack Overflow or by fire
Published on 2010-05-12T12:12:31Z Indexed on 2010/05/12 12:14 UTC
Read the original article Hit count: 139

Filed under:
|

To empty a div and replace it with an image I am using:

    $(this).html('');
    $('<img/>', {
        src: 'blah.gif'
    }).appendTo(this);

Is there a better way to do this?

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about JavaScript