- C# code
<input type="button" id="t1p1z11" class="imgbutton" value=" " onclick="aa()">
我想要点击这个input type="button"并且让按钮背景在1.jpg和2.JPG之间切换,JS部分应该怎么写啊?
------解决方案--------------------------------------------------------
- JScript code
$(document).ready(function() { $("#t1p1z11").toggle(function() { $("#t1p1z11").css("background-image", "url(1.jpg)"); }, function() { $("#t1p1z11").css("background-image", "url(2.jpg)"); }); });