Home > Web Front-end > JS Tutorial > body text

How jQuery implements clicking on the page to obtain the id or other information of the currently clicked element_jquery

WBOY
Release: 2016-05-16 17:04:38
Original
1253 people have browsed it
Copy code The code is as follows:

$(document).click(function (e) {
var v_id = $(e.target).attr('id');
}

Copy code The code is as follows:

$(e.target)

After getting the current element, you can get the tag name, name and other attributes you want to control the click. Which tag triggers the event

js to determine whether a string contains another string

"ssssddd".indexOf("ss")>0
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template