I want to listing all input elements in console of firebug so in console window write the followings:
var inputs = $(":input");
console.log(inputs);
but when I press the Run in console appear null
also when I write just var inputs = $(":input"); the console show Undefined I sure the page have a lot of input elements, where is the problem?
There is nothing wrong with the provided snippet.
Though, without specifying what to write (using
console.log) firebug will print whatever the last statement returned, when declaring a variable usingvarthe result is alwaysundefined.Please make sure that the website in question actually uses
jQuery(bound to global$), and that there really are input elements present in the DOM.Also make sure that the jQuery version running is of a version later/equal to 1.0 (
:inputselector didn’t exists until then).If it has jQuery it probably is of a more recent version, how ever; without you providing us with additional information there is no way to guarantee it.