2 ms·
Ah wow the :checked + * {text-decoration:line-through} is pretty smart! No need for JS in that case. Your reply inspired me for a new version: https://twitter.
by franciscop 6y ago
Ah wow the :checked + * {text-decoration:line-through} is pretty smart! No need for JS in that case. Your reply inspired me for a new version:
https://twitter.com/FPresencia/status/1341037189409296384 https://twitter.com/FPresencia/status/1341037189409296384
https://jsfiddle.net/franciscop/6p9xwv7e/ https://jsfiddle.net/franciscop/6p9xwv7e/
<script>b=u("body").append(u("<input>").on("keyup",e=>{t=e.currentTarget;if(13==e.keyCode){b.append(`<p><label><input type="checkbox"> <span>`+t.value);t.value=''}})).append(u('<button>Clear').on('click',e=>u('p').remove()))</script><style>:checked+*{text-decoration:line-through}