Javascript – how to set content on Jquery dialog

htmljavascriptjquery

$("#note_content").dialog({
            title: "Note",
            modal: true,
            width:'auto',
            height:'auto',
            resizable:false,

            open: function(){
                var note_text = $('#note_content').attr('note_text');
     }
}

In my code I am trying set note_text as content of dialog, any idea how could I do this?

Best Solution

You can try this: DEMO

var SplitText = "Title"
var $dialog = $('<div></div>')
    .html(SplitText )
    .dialog({
        height: 500,
        width: 600,
        title: 'Title'});

$dialog.dialog('open');

$dialog.html('Some text');
​