Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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://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}




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: