Partager via


Sys.Application $find Method

Provides a shortcut to the findComponent method of the Sys.Application class. This member is static and can be invoked without creating an instance of the class.

var o = $find(id, parent);

Arguments

  • id
    A string that contains the ID of the component to find.

  • parent
    (Optional) The component or element that contains the component to find.

Return Value

A Component object that contains the component with the specified ID, if found; otherwise, null.

Remarks

For details about the method that this shortcut represents, see Sys.Application.findComponent Method.

Example

The following example uses the $find method to check whether a custom component exists and to notify the user if the component is missing.

function checkComponent() {
    if (!($find('MyComponent', div1))) {
        div1.innerHTML = 'MyComponent is not available.';
    }
}

See Also

Reference

Sys.Application Class

Other Resources

Language Reference