I’m a total noob in the web arena, I’ve been learning jQuery lately. My concern is, will I be able to access the ‘data‘ attribute using jQuery from my HTML if my browser does not support HTML5?
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.
Yes, you can use the data attribute and you will be able to access it with jQuery even if the browser doesn’t support HTML5:
where you have:
The only thing is that the
dataattribute is not valid if your DOCTYPE is not HTML5 => if you try to use it in HTML 4.01 Transitional for example the validator will cry but your site will work without issues.