I am working with c# code that dynamically generates Anchor tags. I am looking to modify the target attribute of certain anchor tags based on their text.
For example, the HTML code generated by the dynamic c# looks like this:
<a target='_blank' class=txt href="http://www.stackoverflow.com">THE BEST SITE</a>
I would like to change the target attribute if the text is equal to "THE BEST SITE".
Please note: I do not have any jQuery files included in my asp.net project.
So far, I have attempted to include this script in order to get the text, but it does not display the alert message:
$(document).ready(function() {
$(".txt").click(function() {
alert($(this).text());
});
});