Home > Web Front-end > JS Tutorial > Usage example of confirm is used to determine whether to execute the button operation_javascript skills

Usage example of confirm is used to determine whether to execute the button operation_javascript skills

WBOY
Release: 2016-05-16 16:43:52
Original
1448 people have browsed it
<script type = "text/javascript" language = "javascript"> 
function clear1() { 
if(confirm("确定要清空数据吗?")) { 
document.main.text1.value = ""; }
} 
</script>
<body>
<form name="main"> 
<input type="text" name="text1" /> 
<input type="button" name="Submit" value="清空数据" onClick="return clear1();">
</form>
</body>
Copy after login
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template