• function

then

 

Then is used to chain a sequence of actions to be run one after the other. This is useful when many asynchronous actions need to be performed before some final check needs to be made.

The following clicks and types into the id='age' element and then checks that only numeric characters can be entered.

Example

Syn('click',{},'age')
  .then('type','I am 12',function(){
  equals($('#age').val(),"12") 
})
If the element argument is undefined, then the last element is used.