Use created attribute with javascript in select list
<p>im trying to access an attribute that i created in a select list.</p>

<pre><code>&lt;script language="JavaScript"&gt;
function updateUrl()
    {
        var newUrl=document.getElementById('test').car;
        alert(newUrl);
    }
&lt;/script&gt;

&lt;input type="text" id="test" car="red" value="create Attribute test" size="40"/&gt; 
&lt;input type="button" value="submit" onclick="updateUrl();"&gt; 
</code></pre>

<p>it keep giving me undefined. how do i get the string red from attribute car?</p>

<p>edit. i tried it with the select list it alerts null now</p>

<pre><code>&lt;select name= "test" id= "test" onChange= "updateUrl()"&gt;
     &lt;option value="1" selected="selected" car="red"&gt;1&lt;/option&gt; 
     &lt;option value="2" car="blue" &gt;2&lt;/option&gt; 
     &lt;option value="3" car="white" &gt;3&lt;/option&gt; 
     &lt;option value="4" car="black" &gt;4&lt;/option&gt;    
&lt;/select&gt;
</code></pre>
