Uncaught TypeError: Object [object Object] has no method 'dialog'

Uncaught TypeError: Object [object Object] has no method 'dialog'

Hi, I have a project in wordpress. I am trying to implement dialog box popup  on click of hyperlink.
On click of this link, function shownm1() is called which is placed in .js file. The function contains code to open modal dialog.
But its showing the following error :
Uncaught TypeError: Object [object Object] has no method 'dialog' .

<a href="#" id="test-div1" onclick="shownm1()">Click</a>

function shownm1(){
    jQuery(document).ready(function($) {
//                    alert(1);
    $('#test-div1' ).dialog( "open" );
                                                         
});
}
I suppose the scripts for dialog popup are not loading. Can anyone suggest how to enqueue scripts for the same? Or is there any other problem?
Kindly reply.