How can I convert all numbers in a dataset of a DOM node into JavaScript numbers
<p>I use the <code>data</code> attribute to store strings and numbers in DOM nodes and read them with JavaScript. Unfortunately all values in the <code>dataset</code> are saved as string. So whats is the best way to convert them into numbers but leave the strings.</p>

<p>html:</p>

<pre><code>&lt;input data-minvalue="10" data-startcolor="#00ee00"/&gt;
</code></pre>

<p>expected result: </p>

<pre><code>{
  minvalue: 10,
  startcolor:'#00ee00'
}
</code></pre>

<p><strong>Edit:</strong></p>

<ul>
<li>it has to work with int and float </li>
<li>should not convert '12_test'</li>
<li>should convert '.3' </li>
</ul>
