DOM Common Logic
Jump to navigation
Jump to search
A button
You must be this tall to ride
let l = document.createElement('label'); l.innerHTML = 'Confirm I am at least 1.4m'; let c = document.createElement('input'); l.append(c); c.id = 'tall'; let b = document.createElement('button'); b.innerText = 'Ride the Rollercoaster'; b.disabled = true; b.onclick = ()=>{ document.body.append('Weeee...'); } document.body.append(l,b;
let b = document.createElement('button'); b.innerText = 'click me'; b.onclick = ()=>{ document.body.append('Hello World!'); } document.body.append(b);