Control.setFocus

Syntax

setFocus();

Description

The setFocus method sets the component focus.

Example

To execute the example, add links to the PP.js library and to the PP.css visual styles table. The image named ImgBtn1.png must be available. Create a button - instance of the Button class. Bring the button into the focus:

<div id = "btn1"></div>
<script type="text/javascript">
   var b1 = new PP.Ui.Button({
       Content: "Illustrations",
       ImageURL: "ImgBtn1.png"});
   b1.addToNode("btn1");
   b1.setFocus();
</script>

After executing the example the HTML page will contain the Button component that looks as follows:

See also:

Control