javascript checkbox line-through Code Answer

Hello Developer, Hope you guys are doing great. Today at Tutorial Guruji Official website, we are sharing the answer of javascript checkbox line-through without wasting too much if your time.

The question is published on by Tutorial Guruji team.

I am trying to do a school project. I have to make a list and after the checkbox is clicked supposed to be crossed off. I don’t know Javascript yet and I’m still trying to figure it out. I am wondering why this isn’t working.

function  crossout(id) {
  var box = document.getElementById(id); = "text-decoration: line-through";
    <h1>Hello World!</h1>
    <h3>Shopping List</h3>
    <p id="box1">
      <input type="checkbox" onclick="crossout"("box1") />
    <p id="box2">
      <input type="checkbox" onclick="crossout"("box2") />
    <p id="box3">
      <input type="checkbox" onclick="crossout"("box3") />

    <script src="app.js" charset="utf-8"></script>


You have a typo in your checkboxes:


This should be:


Your original way set onclick only to "crossout".

We are here to answer your question about javascript checkbox line-through - If you find the proper solution, please don't forgot to share this with your team members.

Related Posts

Tutorial Guruji