Posts: 334
Name: El Phantasmo
Location: England, north west
|
Im trying to check / alter the value of a <span> tag, but with no luck. Here is the code Im using:
Code:
<p>
<label for="userName" class="labelDef">Username <span class="highlight">*</span></label>
<input type="text" name="userName" id="userName" />
<span id="userNameValidate" class="highlight">invalid</span>
<label>
<input type="submit" name="button" id="button" value="Submit" onclick="validateUserName()" />
</label>
</p>
Code:
// JavaScript Document
function validateUserName()
{
var userName = document.form1.userName.value;
var userNameValidate = document.form1.userNameValidate;
alert(userNameValidate.value);
}
But Firefox gives the error
Quote:
|
userNameValidate has no properties
|
Does anyone know what Im doing wrong??
|