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

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -