
The following code returns the above.
var b = $(c).parent();
The div id is a color code, when the user clicks to a new section, the jQuery updates a background color. I need to return just the color code of the Id?
I’am sure the answer is embarrassingly simple.
To access the ID you can use jQuery’s
attr()method: [Documentation]:Or you could get at the raw DOM element and grab the ID: