How do you select element by ID in jQuery?

Technology CommunityCategory: jQueryHow do you select element by ID in jQuery?
VietMX Staff asked 3 years ago

To select element use ID selector. We need to prefix the id with “#” (hash symbol). For example, to select element with ID “txtName”, then syntax would be,

$('#txtName')