What is the different within jQuery(‘[id$=”myID”]’) and $(“#<%=myID.ClientID %>”) ?
Which one should be the standard?
What is the different within jQuery(‘[id$=myID]’) and $(#<%=myID.ClientID %>) ? Which one should be
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
jQuery('[id$="myID"]')– this selects an element which id is ending withmyID$("#<%=myID.ClientID %>")– this selects an element withid == myID.ClientIDAs for me I’d prefer the second one, it guarantees that exactly 1 element with the specified id will be selected. If you are sure that you have only one element with id ending with
myIDyou can use any of them.