Skip to content

CLICK Event on DIV Element #1393

Open
Open
@JorgeBrandao1980

Description

@JorgeBrandao1980

The html DIV element, it doesn't have the CLICK event set.
And sometimes it's necessary to do this, especially when that element has inserted a hyperlink..

(html.querySelector(
          '#ctl00_ctl00_NestedMasterPage_divTexto_LinkButtonAT_2') as **Element**)
      .click();

Exemple Html:

<div class="bdp "><a id="ctl00_ctl00_NestedMasterPage_divTexto_LinkButtonAT_2" href="javascript:__doPostBack('ctl00$ctl00$NestedMasterPage$divTexto$LinkButtonAT_2','')"> </a></div>

There is no way to click on the html DIV element.

If changing it to another type of element that accepts the 'Click Event' like 'InputElement' gives me the error

    (html.querySelector('#ctl00_ctl00_NestedMasterPage_divTexto_LinkButtonAT_2')
          as **InputElement**)
        .click();

Error: Expected a value of type 'InputElement', but got one of type 'Element'

Thank you, for your work

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions