I want to strike through text in Javascript but I can't seem to get the code to work.
var message = document.getElementById('helloWorld');
setTextContent(message, 'hello world!'.strike());
Would appreciate any help. Would also like to do it without using css.
Should Also mention that these lines of code are inside another function called totalPackage() which runs when the user clicks a button. I want my message hello world! to be displayed when this other function is called.
try this
var message = document.getElementById('helloWorld');
message.innerHTML='<del>helloworld</del>'