Suggest a better way to do the following in jquery . also give me the native js code to do it
$('<div id="dialog-confirm" title="'+confirmbox.title+'"><p><span class="ui-icon ui-icon-alert" style="float:left; margin:0 7px 20px 0;"></span>'+confirmbox.message+'</p></div>')
.appendTo('body');
Why the need. look at "Idiomatic Syntax for Creating Elements" section of this link https://stackoverflow.com/tags/jquery/info