The problem is that the code at the beginning of your JavaScript, (the one that sets up the strikethrough capabilities) never gets called.
To fix this you have to:
-
Place that code inside of a
function
, like the code after it, and -
Add that
function
to thebody
‘sonclick
attribute to make it be called when the page is loaded.
See this JSFiddle. I think it achieves what you were after.
1
solved I’m trying to do a todolist, but it doesn’t work [closed]