javascript - Can't inject HTML into body without loosing everything -


so i'm trying call js function append few divs body

when getelementbyid, can't add body, basically.

document.getelementbyid('advertisingbrandvalues').innerhtml = "test" 

and when

document.body.innerhtml = "test" 

all html replaced 1 element. need add new elements body, not replace whole thing. ideas?

to add bottom:

document.body.innerhtml += "test" 

to add top:

document.body.innerhtml = "test" + document.body.innerhtml 

Comments