locked
Using getElementByID with forms and javascript RRS feed

  • Question

  • I am looking to click a button on a webpage. The button is located on form1 and does not have a specific ID. Below is the html  for the button:

    <input style="width: 100px;" onclick="javascript: jsSearch();" type="button" value="  Search  ">

    my line of code that I am using is:

    $IE.Document.getElementById(“???”).Click() 

    Is there a way to tell this to look for form1 and click the search button?

    Thank you,

    Wednesday, November 22, 2017 8:42 PM

All replies

  • You will have to find the ID of the search button.   That is different on every page.


    \_(ツ)_/

    Wednesday, November 22, 2017 8:56 PM
  • Is there a way to tell this to look for form1 and click the search button?

    Not as long as you're using $IE.Document.getElementById(“???”).Click()

    Can't you just give the button an ID or a name attribute?



    Thursday, November 23, 2017 4:03 PM
  • As jrv suggested, you should identify the 'id' for the button you want to click.

    below is an example one for identifying the 'id' for 'Features' button.


    Regards kvprasoon

    Thursday, November 23, 2017 5:33 PM