title: Javascript - strikethrough
body: <p>i try to make text strikethrough with javascript.
  I know nothing about Javascript and try to search on the net how to that.</p>
  
  <pre><code> &lt;script language="JavaScript"&gt;
              function recal(val,sum)
              { 
                  if(sum == true)
                  {
                      var total = parseInt(document.getElementById("total").innerHTML, 10);
                      total+=val;
                      document.getElementById("total").innerHTML=total;        
                  }
                  else
                  {
                      var total = parseInt(document.getElementById("total").innerHTML, 10);
                      total-=val;
                      document.getElementById("total").innerHTML=total;   
                      var pnl = document.getElementById("totalEvents");
                  }
  
  
  
                  var pnl = document.getElementById("totalEvents");
                  var pnl2 = document.getElementById("eventCategory");
                  var pnl3 = document.getElementById("nameID");
  
                  **strikethrough starts here**
                  if (!sum &amp;&amp; pnl.firstChild.tagName != "S" &amp;&amp; pnl2.firstChild.tagname !="S")
                  {
                      pnl.innerHTML = "&lt;S&gt;"+ pnl.innerHTML+"&lt;/S&gt;";
                      pnl2.innerHTML = "&lt;S&gt;"+ pnl2.innerHTML+"&lt;/S&gt;";
                  }
                  else 
                  {
                      pnl.innerHTML = pnl.firstChild.innerHTML;
                      pnl2.innerHTML = pnl2.firstChild.innerHTML;
                  }
  
  
  
              }
          &lt;/script&gt;
  </code></pre>
  
  <p>it makes textstrikethrough but something is wrong. Even if i choose second checkbox it affects first checkbox why :(</p>
  
  <p><a href="http://jsfiddle.net/aHH9w/" rel="nofollow noreferrer">http://jsfiddle.net/aHH9w/</a> (my full  html page)</p>
  
  <p><img src="https://i.stack.imgur.com/3McSS.png" alt="enter image description here"></p>
  
  <p><img src="https://i.stack.imgur.com/KaFfN.png" alt="enter image description here"></p>