Difference between $find and $get Methods

Author posted by Jitendra on Posted on under category Categories ASP.NET and tagged as Tags , , with Leave a comment on Difference between $find and $get Methods

What is Difference between $find() and $get() Methods in ASP.NET

$get is used to get a reference to a DOM element. It is an alias for Sys.UI.DomElement.getElementById:

var myLabel = $get(‘myLabel’);

$find is an alias for Sys.Application.findComponent() and it’s used to get a reference to a particular component, given its id.

How to get DOM element using $find

var lnkAddNew = $find("CntrlID");
if(lnkAddNew)
{
    lnkAddNew.get_element().style.display = '';
}

Related posts

Leave a Reply

Your email address will not be published. Required fields are marked *