6 ms·
<body><script>x=document;x.write`<input id=a><b id=b></b><p id=d>🆑<ul id=c>`,b[o='onclick']=b=>{b=x.createElement`li`;c.append(b);b.v=b[v='innerHTML']=a.value,
by thybag 6y ago
<body><script>x=document;x.write`<input id=a><b id=b></b><p id=d>🆑<ul id=c>`,b[o='onclick']=b=>{b=x.createElement`li`;c.append(b);b.v=b[v='innerHTML']=a.value,a.value="",b[o]=e=>b[v]=(b[v]==b.v?'<strike>':'')+b.v;d[o]=e=>c[v]=''}</script>
https://jsfiddle.net/eqym2ac0/ https://jsfiddle.net/eqym2ac0/
Working with shrew. 240 char with script/html or 217 with as JS.
- myfonj 6y agoNo JS-in-HTML golfing is complete until you cram your script into onload attribute: --<body><script>…</script> ++<body onload="…"> (But again, would not fulfill the requirements of "sole script in body" :] )