So I am not sure if my title is clear enough. I essentially have a div saved as a Javascript object which looks like this: [div#field_30.checkbox_group]
The field_30 is the ID which I am trying to extract here. doing something like object.id is not working. Does anyone know how to get the ID?
Note: I saved the object like this: var object = $(".workspace .selected"); which grabs the currently selected div inside the object called workspace. Sorry is this is a rookie mistake, I just can’t seem to find anything anywhere. Thanks for the help…
var object = $(".workspace .selected");will return a jQuery wrapped element that has jQuery properties and methods rather than element properties and methods. This means that any ofshould work, but the 1st option should be the best performance-wise. It gets the
idproperty of the the 1st element contained by the jQuery object, which is your div.