Newbie fråga
<dl>
<dt><label for="txtName">Name:</label></dt>
<dd><input name="txtName" type="text" id="txtName" title="Your name" onfocus="colour_background(this.name, 0);" onblur="colour_background(this.name, 0);" /></dd>
</dl>
If you look at the function colour_background() - I'm trying to send the current name to be able to referr to the element from my function.
(which looks like this)
//forms script
function colour_background(object, formNumber) {
var active;
if (active)
{
document.forms[0].object.style.backgroundColor = "#FFF7DF";
active = true;
}
else
{
document.forms[0].object.style.backgroundColor = "#fff";
active = false;
}
}
it would be nice to be able to loop through all the input elements on the page and place a call for this function in all "onfocus" and "onblur" attributes. Does anyone know how to accomplish this?
oj, skrev på engelska ;)... ni fattar.
tack på förhand.
//Henke