function createButton(){
var newEl = document.createElement("header");
var r = document.createTextNode("My Chrome Extension");
newEl.appendChild(r);
document.body.appendChild(newEl);
}
createButton();
So I just learned how to create an element in JavaScript but the element spawns at the bottom left corner of the screen so how do I position it???
You can move your elements around using it's css properties :
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.