JavaScript備忘録

2013-03-17

[][]時刻チェック 11:17

<html>
<head> 
<script language="javascript">
function hoge() {
        var aaa = "19:00";
        //if (aaa.match(/[0-9][0-9]:[0-9][0-9]/)) {
        if (start_time.match(/^\d{1,2}:\d{2}$/)) {
                alert('format ok');  
        } else {
                alert('format ng');
        }
}
</script>
</head> 
<body>
<input type=button value="push" onclick="hoge();">
</body>
</html>