我試圖製作一個具有2個按鈕執行不同動作的網頁。當我點擊一個按鈕時,它正在執行這兩個功能,但我希望它只執行一個功能。在jQuery中聲明多個按鈕
任務3.1:200x200的綠色框格:
<button>Remove</button>
<script>
$(document).ready(function(){
$("button").click(function(){
$("div").remove();
});
});
<br/>
</script>
<button>Animate</button>
<script>
$(document).ready(function(){
$("button").click(function(){
$("div").animate({ left:'300px' });
});
});
</script>
<div style="
width: 200px;
height: 200px;
padding: 25px;
border: 25px solid green;
margin: 25px;
position: absolute;">
</div>
什麼是你的問題/錯誤? – Chrismas007 2014-12-06 21:07:57