javascript - jquery only returns first input element from dev tools console -
i have following html:
<form novalidate="" id="loginform" action="" method="post"> <input type="hidden" name="c" id="c" value="abc"> <input type="hidden" name="initiation" id="initiation" value="test1"> <input type="hidden" name="rmo" id="rmo" value="test2"> ................
i want select input elements, when enter:
$("input") in chrome devtools console, first element:
<input type="hidden" name="c" id="c" value="abc"> what can enter entire list of input elements?
this not stupid question. it's confusing behaviour brought chrome developer tools.
what has happened here you've not included jquery. google chrome has variable/function $ available in chrome developer tools. it's different jquery.
here documentation it: https://developers.google.com/chrome-developer-tools/docs/commandline-api#selector
the documentation in case says:
returns reference first dom element specified css selector.this function alias document.queryselector() function.
so, kind of works jquery, enough fool if don't expect it. , it's available in developer tools. , aliased when install jquery installs in window.$ you'd never know (try printing $ , window.$ in console on blank window).
fix adding jquery html document.
Comments
Post a Comment