How to change the innerHTML of a DIV, and have other elements within it that can not be changed?

1

I have a blog and the attribution of this blog is incorrect and not even altering works. I wanted to use a script that changed the innerHTML within this DIV but without changing any other content.

Example:

function setAttrib(nameof, content){
document.getElementById(nameof).innerHTML=content;
}
But the problem is that inside this DIV there are other items inside it that I can not change and the only item I want to change would be another DIV without ID but it has ClassName, however with a Blog it has several ClassName of the same type.

Please note:

Note that in the image the Attribution ID1 is the item I want to change but has other items within this DIV.

    
asked by anonymous 09.03.2015 / 01:37

1 answer

4

If the inner element is with the class widget-content , do so:

document.querySelector('#Attribution1 .widget-content').innerHTML = 'sei lá';
    
09.03.2015 / 01:45