I have a hyperlink that's being generated dynamically. In addition I have a "p" tag that's being generated dynamically too, but it's hidden. I've attached IDs to both of them and want to use jQuery for the click event. When a user clicks on the hyperlink, it will show that only P tag above it. Normally, I would just add the ending part of the ID, but since you have two dynamic IDs generating, how would you connect them together without triggering others? Down below is a sample of my code:
<asp:ListView runat="server"...>
<ItemTemplate>
<p id="MsgClick" runat="server">You have click on this button></p>
<asp:HyperLink ID="label" runat="server" NavigateURL='<%#Eval("Link")%>' Target="_blank" Text="Click Here"></asp:HyperLink>
</ItemTemplate>
</asp:ListView>
<script type="text/javascript">
$(document).ready(function(){
$([id$='MsgClick']").hide();
$("[id$='label']").on('click', function() {
$("[id$='MsgClick']").show();
})
});
</script>