how to access the checkbox.click inside a list of panels using jquery
I have this hi开发者_StackOverflow社区erarchy, a tabcontainer(tcmain) under that a tabpanel(tpnlRaiseMRF) under that an asp panel(RaiseMRF) under that a checkbox(cbxRecNote). I want to add this function on click. I am adding like this :
$(document).ready(function () { $("#pnlRecNote").hide(); $("#cbxRecNote").click(function () { $("#pnlRecNote").slideToggle(); }); });
the pnlRecNote is directly under form, so its hiding. The cbxRecNote click is not getting fired(above code). but its not working, please help me. I am very new to jquery. Thanks in advance.
Replace your elements with $("[id$=cbxRecNote]")
finding your checkbox is a straight forward way, just use your element's ID.
try this:
$("#cbxRecNote").change(function(){
// type your code here
});
this will take advantage of the browser's native javaScript getElementById()
function which is the fastest way you can have.
check this live demo from here: http://jsfiddle.net/eS8eY/3/
精彩评论