js代码运行点击按钮没反应
<!DOCTYPEhtml><html><head><title>callingfunction</title><script>functionbuttonreport(...
<!DOCTYPE html>
<html>
<head>
<title>calling function</title>
<script>
function buttonreport(buttonId,buttonName,buttonValue) {
var userMessage1="button id:"+buttonId+"\n";
var userMessage2="button name:”+buttonName+"\n";
var userMessage3="button value:"+buttonValue+"\n";
alert(userMessage1+userMessage2+userMessage3);
}
</script>
</head>
<body>
<input type="button" id="id1" name="left hand button" value="left" onclick="buttonreport(this.id,this.name,this.value)"/>
<input type="button" id="id2" name="center button" value="center" onclick="buttonreport(this.id,this.name,this.value)"/>
<input type="button" id="id3" name="right hand button" value="right" onclick="buttonreport(this.id,this.name,this.value)"/>
</body> 展开
<html>
<head>
<title>calling function</title>
<script>
function buttonreport(buttonId,buttonName,buttonValue) {
var userMessage1="button id:"+buttonId+"\n";
var userMessage2="button name:”+buttonName+"\n";
var userMessage3="button value:"+buttonValue+"\n";
alert(userMessage1+userMessage2+userMessage3);
}
</script>
</head>
<body>
<input type="button" id="id1" name="left hand button" value="left" onclick="buttonreport(this.id,this.name,this.value)"/>
<input type="button" id="id2" name="center button" value="center" onclick="buttonreport(this.id,this.name,this.value)"/>
<input type="button" id="id3" name="right hand button" value="right" onclick="buttonreport(this.id,this.name,this.value)"/>
</body> 展开
3个回答
2018-03-21
展开全部
追问
想问一下你这里JavaScript用的是什么开发软件,我是写的文档,很麻烦。
展开全部
<!--
错误原因:有个引号是中文的。
已为你改好。
-->
<!DOCTYPE html>
<html>
<head>
<title>calling function</title>
<script type="text/javascript">
function buttonreport(buttonId,buttonName,buttonValue) {
var userMessage1="button id:"+buttonId+"\n";
var userMessage2="button name:"+buttonName+"\n";
var userMessage3="button value:"+buttonValue+"\n";
alert(userMessage1+userMessage2+userMessage3);
}
</script>
</head>
<body>
<input type="button" id="id1" name="left hand button" value="left" onclick="buttonreport(this.id,this.name,this.value)" />
<input type="button" id="id2" name="center button" value="center" onclick="buttonreport(this.id,this.name,this.value)" />
<input type="button" id="id3" name="right hand button" value="right" onclick="buttonreport(this.id,this.name,this.value)" />
</body>
</html>
错误原因:有个引号是中文的。
已为你改好。
-->
<!DOCTYPE html>
<html>
<head>
<title>calling function</title>
<script type="text/javascript">
function buttonreport(buttonId,buttonName,buttonValue) {
var userMessage1="button id:"+buttonId+"\n";
var userMessage2="button name:"+buttonName+"\n";
var userMessage3="button value:"+buttonValue+"\n";
alert(userMessage1+userMessage2+userMessage3);
}
</script>
</head>
<body>
<input type="button" id="id1" name="left hand button" value="left" onclick="buttonreport(this.id,this.name,this.value)" />
<input type="button" id="id2" name="center button" value="center" onclick="buttonreport(this.id,this.name,this.value)" />
<input type="button" id="id3" name="right hand button" value="right" onclick="buttonreport(this.id,this.name,this.value)" />
</body>
</html>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
var userMessage2="button name:”+buttonName+"\n";// "button name:”闭合引号是中文的。改为英文的引号就好了
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询