anchor is not firing inside a gridview control

Posted by Klbaiju under jQuery on 8/1/2013 | Points: 10 | Views : 1746 | Status : [Member] | Replies : 1
Hi all,
in my application on the click event of button particular cell of gridview will change following is the code

$('#btnsave').click(function (e) {
e.preventDefault();

$('#' + hval).parent().empty().append("<a class='anchor3' id ='" + hval + "' href='#' >booked</a>").css('background-color', 'red');

});
here hval is the id of cell. this is fine and in the cell of gridview an anchor will be added with class=anchor3 as per above code this is working fine.

my requirement is if i click that anchor it should fire. but it is not firing
following is code

$('.anchor3').click(function (event) {

alert("test");
});
how to solve this problem

Regards
Baiju




Responses

Posted by: Rimi1289 on: 8/6/2013 [Member] Starter | Points: 25

Up
0
Down
If its GridView, use this.

$("input[id*=textbox]").val()

Klbaiju, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response