How to replace the internal anchor tag tag inside the Asp.net tag:
Example:
<asp:Label ID="AER_UI_Exam_MPN_ThreeAttemptsBefore_1" runat="server" Text="Please visist: <a id='google'class='translatetext lblfont' href='https://google.com' target='_blank' style="font-size: 12px;">google</a>" CssClass="lblfont translatetext" Style="font-size: 12px;" />
if i get class based id
$(".translatetext").each(function () { var id = this.id; dictionary[id] = $("#" + id + "")[0].innerText; });
I get both identifiers, but the anchor tag is replaced as text, not as a link. here during debugging, I found that for the first id -innertext: Please visist:google , when this inner text is replaced with
"some text"
second identifier not found for anchor . how to deal with this scenario?
Result: Please see: google,
Expected Result: Please see: [google]
source share