I have jquery event in html, this will be triggered when i press the button from the same html(id of the button is used to trigger jquery). Now I have dynamically created button from javascript(another file) code in the same page. When i press button created from js (with the same id) Jquery is not responding. Please help.
The code looks as below.
$(function() {
$( "#dialog" ).dialog({
autoOpen: false,
show: {
effect: "blind",
duration: 1000
},
hide: {
effect: "blind",
duration: 1000
}
});
$( "#opener" ).click(function() {
$( "#dialog" ).dialog( "open" );
});
});
HTML button:
<td width="171" ><div>
<input type="button" id="opener" value="SelDimn"> </div></td>
JS button:
var cell6 = row.insertCell(5);
var element5 = document.createElement("input");
element5.type = "button";
element5.setAttribute('id', 'opener');
element5.name = 'opener';
element5.value = 'SelDimn';
cell6.appendChild(element5);