+ 1
How to create a button using JavaScript any JavaScript alone
Please someone to explain.
2 Antworten
+ 1
Begin with learning to use createElement()
https://developer.mozilla.org/en-US/docs/Web/API/Document/createElement
+ 1
onload=()=>{
let button =document.createElement('button');
button.textContent='button';
document.body.appendChild(button);
button.onclick=()=>{alert("pressed")}
}