我想调用gettotal函数从文本框和* 3中获取值,并在其他文本框中显示结果,代码不起作用 问题在哪里!?html onclick javascript function call to show something
<html>
<head>
<script type="text/javascript" language="javascript">
function gettotal()
{
var x=0;
x=document.getElementById("pop").value*3;
document.getElementById("pop1").innerHTML="<b>"+x+"</b>";
}
</script>
<title>hello</title>
</head>
<body>
<form name="form1">
<input type="button" id="btn" name="btn" value="get" OnClick="gettotal()"/>
<input type="text" id="pop" name="pop" size="3"/>
<br/>
<br/>
<input type="text" id="pop1" name="pop1" size="5" value="val"/>
</form>
</body>
</html>
什么是您遇到的具体“不工作”问题?您在浏览器开发者工具中是否收到任何错误? – ajshort