In implementing my first significant script using jquery I needed to find a specific web-control on the page. Since I work with DotNetNuke, there is no guaranteeing the control
$("#<%= cboPanes.ClientID %>")
This will dynamically inject the DOM ID of the control. Of course, this means your JS has to be in an ASPX file, not in an external JS file.