下面是全部的代码: 怎么取不出文本框里的值呢? 各位帮忙看看,谢谢了!
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
</head>
<script>
function cc()
{
alert(document.getElementsByTagName("cc")[0].value);
}
</script>
<body><input type="text" value="sdfsfdfs" name="cc" />
<input type="button" onclick="cc()" value="显示"/></body>
</html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
</head>
<script>
function cc()
{
alert(document.getElementsByTagName("cc")[0].value);
}
</script>
<body><input type="text" value="sdfsfdfs" name="cc" />
<input type="button" onclick="cc()" value="显示"/></body>
</html>
alert(document.getElementsByName("cc")[0].value);
{
alert(document.getElementsByTagName("cc")[0].value);
return false;
}
应该有个返回值!!!
不知道为什么!但是必须的,要不不好用!
取值应该是:alert(document.getElementsByTagName("input")[0].value);