I’m hoping you can give me some pointers… For some reason when I try and use the data attr on my site I’m unable to get access to it via jquery.
I’ve made a jsfiddle showing I can use this ok but using the same code I end up with a blank.
What do you think could be causing this? Has this happened to you and were you able to debug it?
My site is html5 and passes validation.
Any pointers you could give me to look into would be greatly appreciated.
Edit:
I realised that I was running on a version of jquery that didn’t yet supporting using the data model yet 😐
It may be due to conflict in jQuery versions or with other js frameworks using $ method, check once by just typing $ in your browser console which will return something like
if the problem is with conflicts then use jquery noConflict. To check jquery versions use