I have this code.
<div class="1st-class"></div>
and I have a button, when I click it, the div will be like this.
<div class="1st-class goto"></div>
Now, how can I check the div if the class name has goto?
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.
Give the div an id :
Then do:
Note: You don’t need to give the div an Id. You can use the
.1st-classselector as well. However, giving it an Id makes it uniquely identifiable if you have multiple divs with the class1st-class.References:
jQuery hasClass()