If I have an object like this:
var item = {
id: '1',
description: 'something'
}
then how do I extract one of these values? If I do
alert($(item.id));
then I just get an alert saying 'Object object'. I had a look at this post: Getting the base element from a jQuery object and tried to invoke
alert($(item).get(0));
But with the same result.
Also, from a terminology point of view what are objects like this called so that next time I can be a bit more specific?
alert(item.id);?jQueryis not a king of javascript, you shouldn't need thy king everytime..