Search code examples
javascriptjquerycssprototypejs

trigger click event with css selector in prototype


I am new in Prototype js. I have an element like this,

<li id="toolbar-save" class="button">
  <a class="toolbar"  href="www.mydomain.com/register">
     Save &amp; Close
  </a>
</li>

I have a selector for the anchor tag, $$('#toolbar-save a'). By using this selector how can I trigger the click event ? or any other way you can suggest ? thanks in advance.


Solution

  • $$('#toolbar-save a')[0].click();
    

    FIDDLE