2024-09-29 15:12:05
<html><body>
<head><meta charset="utf-8">
<script type="text/javascript">
function check(){
var index=document.getElementById("username").value;
if (/^[A-Z]+$/.test(index)) //a-z
{
alert("true");
}
else {
alert("请输入大写英文字母");
return false;
}
}
</script>
</head>
<body>
<input type="button"value="提交" onClick="check()">
<input type ="text" id="username">
</body>
</html>
2024-09-29 09:07:38