Click here to Skip to main content
15,889,595 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
What is the best way to select elements based on ID in JQuery

JavaScript
$('[id=iden]');

XML
where


    var iden = e.target.id;
Posted

1 solution

id is a standard HTML attribute, that all HTML element has (even you didn't defined it directly) and jQuery addresses it separately and not as any other attribute...
The format is $('#id')...
https://api.jquery.com/id-selector/[^]
https://api.jquery.com/category/selectors/[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900