lundi 30 novembre 2015

Changing div text layouts the whole document

I want to change the text inside a div with javascript (jQuery is ok too).
There are a few to do that:

element.innerText  
element.innerHTML  
element.textContent  
$(element).text()  
$(element).html()  

But when I use the above methods, the whole document is affected and not only the div.
See chrome timeline below which refers to this fiddle

Is there a way to update the text inside the div without affecting the whole document?

enter image description here enter image description here




Aucun commentaire:

Enregistrer un commentaire