I am using MVC with C#.
I need to get the value from the hidden field of the active accordion in $(document).ready function.
I am using MVC with C#.
I need to get the value from the hidden field of the active accordion in $(document).ready function.
Without knowing in more detail what your actual code is like, this is the closest guess I can give:
$(".ui-accordion .selected input[type=hidden]").val();
jQuery UI accordions have a "ui-accordion" class and automatically apply the "selected" class to the currently expanded accordion element.
accordion doesn't add the class selected, but ui-accordion-content-active.
Try:
alert('value ' + $('.ui-accordion .ui-accordion-content-active input[name$=EId]').val());
I have run into this "strangeness" with jQuery; it seems the selector is returning an array of objects so you have to use the "[0]" to get the element you are looking for.