title: JS str.split() won't work with data fetched with Jquery?
body: <p>I'm trying to split a string with JS.<br></p>
  
  <p>I have two cases:<br>
  1234 &amp; 1234-1</p>
  
  <p>If i try to split the case with "-" it works fine.<br>
  But when the case is without the "-" it will give me an error:
  
  <blockquote>
    <p>str1.indexOf is not a function
        at HTMLAnchorElement.</p>
  </blockquote>
  
  <p>I guess this has something todo with Jquery?<br></p>
  
  <p><strong>JQUERY</strong><br></p>
  
  <pre><code>//THIS DON'T WORK
  var nr = $(this).parent('td').siblings('.td_objNr').data('objnr'); // nr = 12345
  
  var str1 = nr;
  var str2 = "-";
  if(str1.indexOf(str2) != -1){
      nr = nr.split('-');
      nr = nr[0];
  }
  
  //THIS WORKS
  var nr = '12345';
  
  var str1 = nr;
  var str2 = "-";
  if(str1.indexOf(str2) != -1){
      nr = nr.split('-');
      nr = nr[0];
  }
  </code></pre>