Reputation: 412
I have HTML:
<div>AAAAA</div>
<div id="bbb"></div>
<fish></fish>
And JS/jQuery:
$('#bbb').replaceWith('<div>BBBB</div>');
$('fish')[0].replaceWith('<div>CCCC</div>');
What gets displayed (on Chrome) is:
AAAAA
BBBB
<div>CCCC</div>
It appears that once the browser marks an element bad, it won't re-evaluate it when it's changed. How can I make it display:
AAAAA
BBBB
CCCC
I can't figure out how to do it. Any help would sure be appreciated.
Thanks.
Blake McBride
Upvotes: 2
Views: 136
Reputation: 2066
Custom dom elements/components do not have full browser support yet, you may check here.
My advice would be to use div
's with css classes or id's. Otherwise, you cannot really do much without using a reactive framework from the entire forest of frameworks there is, as they would allow you to define those custom elements and perform actions with them.
Upvotes: 2