DOM Controls that do things

From ProgZoo
Revision as of 00:33, 30 August 2021 by Andr3w (talk | contribs)
Jump to navigation Jump to search

let b = document.createElement('button');
b.innerText = 'click me';
b.onclick = ()=>{
  document.body.append('Hello world');
}
document.body.append(b);
let b = document.createElement('button');
b.innerText = 'click me';
b.onclick = ()=>{
  document.body.append('Hello world');
}
document.body.append(b);