Monday, April 30, 2012

Use created attribute with javascript in select list

im trying to access an attribute that i created in a select list.



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

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


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





No comments:

Post a Comment