Home >Web Front-end >JS Tutorial >jQuery on method passing parameter example_jquery

jQuery on method passing parameter example_jquery

WBOY
WBOYOriginal
2016-05-16 16:28:011530browse

Teach you how to pass parameters to the function bound to the jQuery on method. The code is as follows:

Copy code The code is as follows:

$(".loadingFlower").on("click",'',{name:"123",id:"234",tel:"345"},callback)

function callback(event){
console.log(event.data.name); //Parameter 1 =>123
console.log(event.data.id); //Parameter 2 =>234
console.log(event.data.tel); //Parameter 3 =>345
}
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn