title: Onclick not working. Cannot read property 'click' of null
body: <p>I keep receiving the following error from the browser console when loading my script into my <a href="http://phoneparter.com/" rel="nofollow">Magento store</a>. All that it is listening for is an onclick event on a div yet I receive this error:</p>
  
  <p>"Uncaught TypeError: Cannot read property 'click' of null."</p>
  
  <p>The script works in <a href="https://jsfiddle.net/p1dvswnm/9/" rel="nofollow">JSfiddle</a> so I'm really not quite sure why it isn't working. I've tried enclosing it within a $( document ).ready() as well but I receive the same error.</p>
  
  <p><strong>Code:</strong></p>
  
  <pre><code>var step = 0;
  var deviceType = "";
  var modelType = "";
  
  function showGen(){
      $('.phoneTypes').css("display", "none");
  
      if (deviceType == "Samsung"){
        $('.sphoneGens').css("display", "block");
      }
      if (deviceType == "iPhone"){
        $('.iphoneGens').css("display", "block");
      }
      if (deviceType == "iPad"){
        $('.ipadGens').css("display", "block");
      }
  }
  
  // Pick Device Type
  $('.choicelabel').click(function(){
      deviceType = $(this).children('input').val();
      showGen();
  });
  
  //Pick Device Gen
  $('.choiceType').click(function(){
      modelType = $(this).children('input').val();
      //$(".iphoneGens").css("display", "none");
      console.log(deviceType);
      console.log(modelType);
      $(this).parents(".row").hide();
  });
  </code></pre>
  
  <p>Any help debugging this issue will be greatly appreciated.</p>