title: How do I modify a css element with Jquery after appended with Jquery to a div?
body: <p>I am making a todo list so I am adding new input tags with checkboxes on them so I can check off a to do list item. I am having trouble modifying the css so that the text displays a line through it when it is checked.
  The check function works and it runs but I am unable to put a line through the specific html element.</p>
  
  <pre><code>var add = function() { 
  var task = $("#taskTextBox").val(); // references the value inside #task
  if(task != ""){
      inc++;
      var itemName = "item" + inc;
  
      var newObj = $("#list").append("&lt;input id="+itemName+" type=checkbox class="+itemName+"&gt;"+task+"&lt;br&gt;&lt;/br&gt;");// makes a new &lt;p&gt; element
      $("#taskTextBox").val(""); // empties out #task
      var newHeight = $("#list").height() + 40;
      $("#list").css({"height": newHeight});
      addAttributes();
  
  
  $("input[class=" + itemName + "]").change(function () {
      if ($(this).prop("checked")) {
  
      $("input[class=" + itemName + "]").css({'text-decoration': 'line-through'});
  
      } else{
          $("#list").css({"text-decoration":  "none"});
      }
  }); 
  }};
  </code></pre>