http://www.perlmonks.org?node_id=1080933

diwaniuk has asked for the wisdom of the Perl Monks concerning the following question:

Hi, I am trying to click a checkbox that looks like the following:
<td><input id="chkBsc" type="checkbox" class="rdo" onclick="clkBsc();" +></td>
How can I do this? I know function tick() but they accept only 'name' and 'value' but not 'id';

Replies are listed 'Best First'.
Re: WWW::Mechanize::Firefox and checkbox
by Corion (Patriarch) on Apr 03, 2014 at 12:12 UTC

    The documentation for ->tick says as its last sentence:

    If $name is a reference to a hash, that hash will be used as the options to ->find_link_dom to find the element.

    So you can pass the appropriate parameters for ->find_link_dom:

    $mech->tick( { id => 'chkBsc' }, '', 1 );
      Now it's works! Thanks a lot!