How can I safe the word “Good” and the numbers in a variable?
<div id="infoTable">
<div class='info' label='Good' value='1' minvalue='2' maxvalue='3'></div>
<div class='info' label='Bad' value='4' minvalue='5' maxvalue='6'></div>
</div>
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.
First you find the
divthey’re in:That uses
$to find the divs inside yourinfoTablediv, then usesfirstto get just the first one. (You can also dovar theDiv = $("#infoTable div:first");but it’s probably no more efficient.)Then you read its attributes:
If you want the numbers as numbers rather than strings: