chicken.king
04-27-2005, 04:40 AM
hello
Why is this code contain error ?
<html>
<head>
<title>check</title>
<script language = "javascript">
function check() {
var x = document.getElementById("test");
alert(x.value);
var y = x.value.length;
alert(y);
var check = x.search(/ \w{8}/);
}
</script>
</head>
<body>
<form action ="">
<input type = "text" id = "test" name = "test" maxlength="10"/><br/>
<input type = "button" id= "hello" name="hello" value = "check" onclick = "check()";/>
</form>
</body>
</html>
"ERROR : object doesn't support this property and method"
Why is this code contain error ?
<html>
<head>
<title>check</title>
<script language = "javascript">
function check() {
var x = document.getElementById("test");
alert(x.value);
var y = x.value.length;
alert(y);
var check = x.search(/ \w{8}/);
}
</script>
</head>
<body>
<form action ="">
<input type = "text" id = "test" name = "test" maxlength="10"/><br/>
<input type = "button" id= "hello" name="hello" value = "check" onclick = "check()";/>
</form>
</body>
</html>
"ERROR : object doesn't support this property and method"