当我点击它支持的按钮淡入和淡出红色按钮时,但它不是那么问题是什么?
我的代码:
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
${"button").click(function(){
$("div").fadeToggle();
});
});
</script>
</head>
<body>
<button>Click Here To FadeToggle</button><br><br>
<div style="width:80px;height:80px;background-color:red;"></div>
</body>
</html>
答案 0 :(得分:1)
更改:强>
${"button")
^---------------
要强>
$("button")
^---------------
$(document).ready(function(){
$("button").click(function(){
$("div").fadeToggle();
});
});
&#13;
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<button>Click Here To FadeToggle</button><br><br>
<div style="width:80px;height:80px;background-color:red;"></div>
&#13;