I have two divs. Clicking on a jqueryui button (button1) in first div (div1) creates a jquery ui button (button2) in the second div (div2) with a data element identifying the button1 that created it; also the click hides (or disable works too) the clicked button (button1).
When i click on button2, i want to show/enable button1; however, this does not work. This seems to be a problem only with dynamically hidden/disabled buttons.
<div id="pane1>
<a id="123" class="addme jqb">Add</a>
</div>
<div id="pane1>
<a id="345" data-target='123' class="deleteme jqb">Delete</a>
</div>
$(function(){
$('.jqb').button();
$('.deleteme').button('disable');
$('.addme').on("click", function(){
$(this).button('disable');
$('.deleteme').button('enable');
});
$('.deleteme').on("click", function(){
$(this).button('disable');
$('#123').button('enable');
});
});
Here is a fiddle containing the simplified version of the code - https://jsfiddle.net/x7u1xLg8/16/