$("#bankAccountNumber")
alert("
var account = $("channelForm
alert("
var reg = /^d{
if( !reg
{
alert("格式錯誤
}
})
<!DOCTYPE html PUBLIC "
<html xmlns="
<head>
<meta http
<title>驗證銀行賬號</title>
<style type="text/css">
<!
</style>
<script language="javascript" type="text/javascript">
function check()
{
var account = document
var reg = /^d{
if( !reg
{
alert("格式錯誤
}
else
{
alert("驗證成功!");
}
}
</script>
</head>
<body>
<form id="form
<p>賬號
<input type="text" name="account" id="account" />
<span class="STYLE
<p>
<input type="button" name="button" id="button" value="驗證" onclick="check()" />
</p>
</form>
</body>
</html>
From:http://tw.wingwit.com/Article/program/Java/JSP/201311/20379.html