On performing inspect element on google.com input, I get:
<input class="gsfi" id="lst-ib" maxlength="2048" name="q" autocomplete="off" title="Search" type="text" value="" aria-label="Search" aria-haspopup="true" role="combobox" aria-autocomplete="both" dir="ltr" spellcheck="false" style="border: none; padding: 0px; margin: 0px; height: auto; width: 100%; background: url("data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw%3D%3D") transparent; position: absolute; z-index: 6; left: 0px; outline: none;">
Now if I do: $("#lst-ib")
, I get input object as expected. But if I do: $("#lst-ib").val("hello world!")
, I get an error:
Uncaught TypeError: $(...).val is not a function(…)
Same thing is happening with Bing.com. Can someone explain why is it happening and how can I search on these website by using Javascript
or Jquery
.