假设我有10个按钮.我想要隐藏除第一个按钮之外的所有按钮.
我试图在jQuery中使用each()完成它,但它不起作用.
这是我的剧本.这只是一个测试,看看我是否可以得到按钮的索引.没有出现错误.
$('button').each(function(index){
alert(index);
});
Run Code Online (Sandbox Code Playgroud)
附加信息:
我的整个剧本就是这个
$(function(){
$('div#here').load('test.php'); // This is where all the buttons will come from
$('button').each(function(index){
alert(index);
});
});
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2299 次 |
| 最近记录: |