1
With jQuery I can see the properties of an element on the console with:
console.log($("elemento"));
For example, if I have the element below:
<input id="nome" type="text" placeholder="Digite aqui">
And I do console.log($("#nome"));
, the console shows:
How I get the same result with pure Javascript?
I tried with console.log(document.getElementById("nome"));
, but returns only the outerHTML
of the element:
Use
console.dir
– Andre
It worked. What is this console.dir? Haven’t heard of it yet
– Sam
The console.dir in theory should display the properties of an object interactively, but in Chrome the console.log does the same. How the behavior of the object
console
is not standardized, in each browser works in a different way.– Andre
I tested on Chrome the console.log and did not show, but the console.dir showed. Anyway, obg! If you want to post a reply, I mark as sure.
– Sam