简体   繁体   中英

How to display Alert in Javascript

如何在javascript中显示简单的警报,而警报的标题却没有标题-只是带有消息的空白警报。

It is not possible with browser's native alert box. However you can always use JavaScript alert box.

  function showAlert(){ $( "#dialog" ).dialog({modal: true}); } 
  <link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css"> <script src="https://code.jquery.com/jquery-1.12.4.js"></script> <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script> <body> <input type="button" value="Alert" onClick='showAlert()'> <div id="dialog" title="" style="display: none;"> <p>Alert box. Lorem Ipsum.</p> </div> </body> 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM