Simply, I have an anchor inside a repeater that triggers on click a javascript function, which sets the innerHTML of a Div to some content.
trying this outside a repeater did work! but if I tried to implement the same code in the repeater's item template, it won't work!
NOTE: I think I need to access the repeater first then access the Anchor inside it! but I don't know how to do it
For further illustration:
JavaScript Function:
function show(ele, content) { var srcElement = document.getElementById(ele); if (srcElement != null) { srcElement.innerHTML = content; } } The repeater's code:
<asp:Repeater ID="Repeater1" runat="server" > <ItemTemplate> Name : <%# Eval("name")%> <DIV ID= "PersonalInfo1" runat="server"></DIV> <A id="A1" href="#" runat="server" onclick="show('PersonalInfo1','Address : ')">More...</A> </ItemTemplate> </asp:Repeater> PS: THE POSTED CODE ISN'T WORKING IN THE REPEATER!