goo*_*ing 0 javascript php ajax jquery
这是一个代码:
<input type="button" id="array[1]" value="Value1" />
<input type="button" id="array[2]" value="Value2" />
<input type="button" id="array[3]" value="Value3" />
Run Code Online (Sandbox Code Playgroud)
我想做那样的事情:
$('#array').click(function() {
id = this.id;
$.ajax({
here goes type, url, data and else
});
})
Run Code Online (Sandbox Code Playgroud)
我想id添加数组的编号.例如,如果我单击id所在的按钮,array[3]那么id在Jquery的函数中获取值3.希望你明白我的意思.
| 归档时间: |
|
| 查看次数: |
328 次 |
| 最近记录: |