If you want to find a special control when there can be several copies, this is not possible. How would external javascript know which of the n controls you want?
How can you bring behavior to a class and find elements relative to the position of the action control, for example:
UserControl:
<div class="myControl"> <asp:Button id="MyButton" runat="server" Text="Click Me" /> <div style="display:none;">Show me!</div> </div>
If jQuery was written as relative:
$(".myControl input").click(function() { $(this).next().slideDown(); });
In this case, it does not matter what the specific identifiers are if you can navigate the DOM relative to the controls you need. Even if it's more complicated, like .closest("div").next().find(".bob").prev() ... all you need to work there.
source share