IndexOf with decimals
<p>I'm looking for a bit of help ironing out a bug in a search form I'm working on. </p>

<p>I have a form of multiple checkboxes which submits via AJAX to PHP and returns a query string for use in deep-linking. The query string is used to check checkboxes on the page that appear in the query string. </p>

<p>The query string looks like this:</p>

<pre><code>var returnedResults = #Size=35.5&amp;Size=36&amp;Colour=red&amp;Material=leather
</code></pre>

<p>I have a form with a series of checkboxes like this:</p>

<pre><code>&lt;input type="checkbox" name="Size[]" id="35" value="35"&gt;
&lt;input type="checkbox" name="Size[]" id="35.5" value="35.5"&gt;
&lt;input type="checkbox" name="Size[]" id="36" value="36"&gt;
...
&lt;input type="checkbox" name="Colour[]" id="red" value="red"&gt;
...
</code></pre>

<p>I am using jQuery's each function to loop through the checkboxes and check them if they appear in the query string:</p>

<pre><code>$('input').each(function(){
  if (returnedResults.indexOf($(this).val()) &gt;= 0) {
   // check the box
  }
});
</code></pre>

<p>This works fine for the most part but appears to return true for Size=35 when Size=35.5 is the only thing in the query string. ie. the checkbox with value=35 is checked when returnedResults=#Size=35.5</p>

<p>Is this a quirk of indexOf when dealing with decimals or is there something I'm doing wrong?</p>

<p>Many thanks for your help in advance.</p>
