I'm using accordion jQuery UI , in each accordion there are some fields, I want to be able to change each accordion Title by using the first input[type=text] of each accordion
This JS which I wrote, but only work for the first input[type=text] of the first accordion and I want for each accordion
$('.redux-groups-accordion-group input[type=text]:first').live('keyup',function(event) {
$(this).parents('.redux-groups-accordion-group:first').find('.redux-groups-header').text(event.target.value);
});
HTML :
<div id="redux-groups-accordion">
<div class="redux-groups-accordion-group">
<h3 class="ui-accordion-header">
<span class="redux-groups-header">New Slide Title</span>
</h3>
<div class="ui-accordion-content">
<input type="hidden" name="id" />
<input type="text" name="title" />
<input type="text" name="tags" />
</div>
</div>
<div class="redux-groups-accordion-group">
<h3 class="ui-accordion-header">
<span class="redux-groups-header">New Slide Title</span>
</h3>
<div class="ui-accordion-content">
<input type="hidden" name="id" />
<input type="text" name="title" />
<input type="text" name="tags" />
</div>
</div>
</div>