• function

type FuncUnit.prototype.type

 

type(text [,success])

Types text into an element. This makes use of [Syn.type] and works in a very similar way.

Quick Examples

//types hello world
S('#bar').type('hello world')

//submits a form by typing \r
S("input[name=age]").type("27\r")

//types FuncUnit, then deletes the Unit
S('#foo').type("FuncUnit\b\b\b\b")

//types JavaScriptMVC, then removes the MVC
S('#zar').type("JavaScriptMVC[left][left][left]"+
                     "[delete][delete][delete]")

//types JavaScriptMVC, then selects the MVC and
//deletes it
S('#zar').type("JavaScriptMVC[shift]"+
               "[left][left][left]"+
               "[shift-up][delete]")

Characters

For a list of the characters you can type, check Syn.keycodes.

Parameters

  1. text {String}

    the text you want to type

  2. success {function()}Optional

    a callback that is run after typing, but before the next action.

Returns

{FuncUnit}

returns the funcUnit object for chaining.