replacing the superfluous 'innerHTML' with something else. Javascript -
im looking replacement .innerhtml.. can clear div , replace string of code have.. problem innerhtml forces me use superfluous code (anyone know why?) // , can't seem break '<br>
more once in line..
ive tried search answer cant find any. appreciated.
use jquery.
$('#mydiv').replacewith(whatever);
that replace entirety of dom element whatever put in it's place..
$('#mydiv').html(whatever);
that retain dom element while replacing of contents of div in same way innerhtml does.
$('#mydiv').append(whatever);
that retain dom element , it's content , add content onto of element.
$('#mydiv').prepend(whatever);
that retain dom element , it's content , add content onto front of element.
Comments
Post a Comment