I have a string containing my html content in code behind link like this
"1.I need to add a onclick event to this link.
2.Need to get the href value.
I dont have a id or class for the link so cant access it directly using Javascript. I am a newbie to Jquery. Kinda stuck in here. How can I achieve this ?
I tried using the Javascript onclick solutions by preventing default functionality, but MY HTML CONTENT IS GENERATED AT RUNTIME. So whatever I write in document.ready doesnt seem to work at all.
解决方案$("a").click(function(e){
var a_href = $(this).attr('href');
e.preventDefault();
});