当前位置:精东方网络知识网 >> 网站建设 >> 详情

jquery怎么弹窗

使用jQuery可以使用以下方式弹窗:

jquery怎么弹窗

1. 弹出警告框:`alert("Alert!");`

2. 弹出确认框:`confirm("Are you sure?");`

3. 弹出提示框:`prompt("Please enter your name:");`

4. 使用jQuery UI的对话框插件弹出自定义的弹窗。首先需要包含jQuery UI的库文件,然后使用以下代码创建一个对话框:

```

$("

Custom Dialog
").dialog({

modal: true,

buttons: {

"Save": function() {

// Save button handler

$(this).dialog("close");

},

"Cancel": function() {

// Cancel button handler

$(this).dialog("close");

}

}

});

```

标签: