Reputation: 17600
I want to see in the console all the available properties on an html element.
console.log(myEl);
Just logs the html structure of the object.
Upvotes: 0
Views: 194
Reputation: 43188
var a = document.getElementsByTagName('a')[0];
for (var key in a)
console.log(key, a[key]);
Upvotes: 0
Reputation: 29434
var str = "";
for ( var attr in myEl )
{
if (typeof myEl[attr]!="function")
str += attr + ":" + myEl[attr] + "\n";
}
console.log(str);
Upvotes: 0