Re:Show HN: A TO-DO app that fits inside a single tweet
by thybag on Monday December 21, 2020 @10:21AM
(#25495704)
<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/
Working with shrew. 240 char with script/html or 217 with as JS.
Re:Show HN: A TO-DO app that fits inside a single tweet
by myfonj on Monday December 21, 2020 @01:42PM
(#25497954)
No 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" :] )
Combining yours & the strike thru example, managed to get both strike thru & clear added in 277 chars. If i could save another char could close the p which would be nice :p
https://jsfiddle.net/hysjgkcm/
Down to 270 https://jsfiddle.net/vr7246jk/1/