简体   繁体   中英

How to close Javascript alertbox by using the enter key

How to close Javascript alertbox by using the enter key..

function validate(){
     if (document.getElementById("<%=username.ClientID%>").value == "") {
         alert("Please select UserID.");              
         return false;
     }
}

Actually I'm using custom Alert like: Var msg=new alert(); This is not closing...

There is no way to control an alert() other than initially creating it. There are no events and no way of changing it once it is created. If you need more control, consider creating a modal dialog, for example with jQuery UI.

Docs

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