<html>
<head>
<script language="javascript">
function change(){
bt1.value="111"
}
</script>
</head>
<body>
<form>
<input type="button" name="bt1" value="222" onClick="change()"/>
</form></body>
</html>我想单击按钮时改变按钮文字,为啥不行呢?
<head>
<script language="javascript">
function change(){
bt1.value="111"
}
</script>
</head>
<body>
<form>
<input type="button" name="bt1" value="222" onClick="change()"/>
</form></body>
</html>我想单击按钮时改变按钮文字,为啥不行呢?
<head>
<script language="javascript">
function change(btn){
btn.value="111"
}
</script>
</head>
<body>
<form>
<input type="button" name="bt1" value="222" onClick="change(this)"/>
</form></body>
</html>
function change(bt1){
bt1.value="111"
}
<head>
<script language="javascript">
function change(){
document.getElementById("bt1").value="111"
}
</script>
</head>
<body>
<form>
<input type="button" id="bt1" value="222" onclick="change()"/>
</form></body>
</html>
document.getElementsByName("bt1")[0].value='111';
<head>
<script language="javascript">
function change(){
document.getElementById("bt1").value="111"
}
</script>
</head>
<body>
<form>
<input type="button" name="bt1" value="222" onClick="change()"/>
</form></body>
</html>
Web 开发常用手册DHTML 参考手册
http://download.csdn.net/source/308913JScript 语言参考
http://download.csdn.net/source/308916CCS 样式表中文手册
http://download.csdn.net/source/304124
<head>
<script language="javascript">
function change(){
var f = document.getElementsByTagName("form")[0]
f.bt1.value="111"
}
</script>
</head>
<body>
<form>
<input type="button" name="bt1" id="bt1" value="222" onClick="change()"/>
</form></body>
</html>