javascript - Insert html div in js and take selector from it -


i have html content of dialog button:

<div id="dialogid" class="someclass" style="somestyle">     <p>some content buttons</p> </div> 

i need insert using js , take div id selector showing ui dialog:

ajs.dialog2("#dialogid").show(); ajs.$("#somebuttonid").click(function closewindow() {     ajs.dialog2("#dialogid").hide(); }); } 

how can this? thanks.

$('body').append('<div id="dialogid" class="someclass" style="somestyle"><p>some content buttons</p></div>');  $('#somebuttonid').on('click',function(){ $('dialogid').hide();//to close dialog //$('dialogid').show();//to show dialog }) 

check code


Comments