jQuery event.data 属性
jQuery 教程
· 2019-03-10 22:13:32
实例
对每个 <p> 元素返回通过 on() 方法传递的数据:
$("p").each(function(i){
$(this).on("click",{x:i},function(event){
alert("序号:" + $(this).index() + ". 段落的数据为: " + event.data.x);
});
});
$(this).on("click",{x:i},function(event){
alert("序号:" + $(this).index() + ". 段落的数据为: " + event.data.x);
});
});
定义和用法
event.data 属性包含当前执行的处理程序被绑定时传递到事件方法的可选数据。
语法
event.data
| 参数 | 描述 |
|---|---|
| event | 必需。event 参数来自事件绑定函数。 |
点击查看所有 jQuery 教程 文章: https://codercto.com/courses/l/35.html
Introduction to Linear Optimization
Dimitris Bertsimas、John N. Tsitsiklis / Athena Scientific / 1997-02-01 / USD 89.00
"The true merit of this book, however, lies in its pedagogical qualities which are so impressive..." "Throughout the book, the authors make serious efforts to give geometric and intuitive explanations......一起来看看 《Introduction to Linear Optimization》 这本书的介绍吧!