Dear Sir,
How will clear a textbox alert ok using JavaScript. When user insert some datas after pop up a alert Ok. when user click ok the text box clear
Hi rajeesh,
Refer below sample.
HTML
<html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <script type="text/javascript"> function Save() { alert(document.getElementById('txtName').value); document.getElementById('txtName').value = ""; } </script> </head> <body> <div> <input type="text" id="txtName" /> <br /> <input type="button" value="Submit" onclick="Save();" /> </div> </body> </html>
Demo
© COPYRIGHT 2025 ASPSnippets.com ALL RIGHTS RESERVED.