【发布时间】:2015-03-01 12:15:47
【问题描述】:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
<style>
#circle {
width:200px;
height:200px;
background-color:blue;
border-radius:100px;
margin:10px;
}
</style>
<script src="file:///C|/Users/Gopal/Desktop/jquery-1.11.2.js"></script>
</head>
<body>
<div id="circle"></div>
<p>THIS IS A CIRCLE</p>
</body>
<script>
$("#circle").click(function() {
$("p").hmtl("its changed");
});
</script>
</html>
当我单击圆圈时,我希望圆圈下方的文本更改为我的 $("p").hmtl("its changed"); 但它没有发生
【问题讨论】:
-
打开浏览器的错误控制台。错误消息应该能很好地提示问题所在。
-
它的
html不是hmtl,函数拼写错误 -
["TypeError: $(...).hmtl is not a function " It not a function is the error]Thanks-Juhana [是的,我从“hmtl”更改为“html”它起作用了]-谢谢 Saptal。