what's the meaning of this

var theme =  $.data(document.body, 'theme');

Thanks in advance
Who is Participating?
Php_expertConnect With a Mentor Commented:
Refer this link for more information about data storage using jQuery:

Kiran SonawaneConnect With a Mentor Project LeadCommented:
Go through this link you will get an idea about .data()

HugoHiaslConnect With a Mentor Commented:
It reads an attached stored data-value from the document.body that has the name "theme".

Take a look in the source for an attribute data-theme="value" in the body tag.
netballiConnect With a Mentor Commented:
The Variable "theme" is being assigned a data attribute for theme,  the  $.data()  stores a reference to a variable, which could even be a global variable in a DOM element for the HTML page.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.