So, let say I have this:
var d = document.createElement('div');
d.id = "whatever";`
So, d is the DOM object,
how can I create or convert it into jQuery object?
e.g.
$(d) ???
and, how to ‘read’ all attributes of the jQuery object? just like the var_dump of PHP.
or just wrap the dom element in
$()as you suggested:Use
attrto get/set element attributes. I’m not sure if there’s a one-liner that can dump all of an element’s attributes and their respective values (firebug serves that purpose for me), but you can create an array with all the attribute names you’re interested in, and do something like:or using
$.each: