FuncUnit.prototype.click  function     

Clicks an element. This uses Syn.click to issue a:

  • mousedown
  • focus - if the element is focusable
  • mouseup
  • click

If no clientX/Y or pageX/Y is provided as options, the click happens at the center of the element.

For a right click or double click use FuncUnit.rightClick or FuncUnit.dblclick.

Example

//clicks the bar element
S("#bar").click()
func_unit.click(options, callback) -> funcUnit
{optional:Object}

options to pass to the click event. Typically, this is clientX/Y or pageX/Y like:

$('#foo').click({pageX: 200, pageY: 100});

You can pass it any of the serializable parameters you'd send to : initMouseEvent, but command keys are controlled by FuncUnit.type.

{optional:Function}

a callback that runs after the click, but before the next action.

{funcUnit}

returns the funcunit selector for chaining.

© Jupiter IT - JavaScriptMVC Training and Support