On the press of a div (which I made into a button with other code) I would like the following code:
<div id="w1" name="w1-0" onclick="weekclick(id)">1<br /></div>
...for the name to change from name="w1-0" to name="w1-1"
I'm using the following JavaScript:
function weekclick(id)
{
document.getElementById(id).input.name = "w1-1";
}
When I alert the id's name attribute, it says it is undefined. What do?
nameattribute, and DivElementNode objects do not have aninputproperty. Div elements are designed to be generic containers, if you want a button, then use a<button>.nameattribute used for? What's it's purpose on the page?