time
by Krishna Ananthi
HTML
<<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>`</title>
<script>
function myfun(v){
if(/^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$/.test(v))
console.log('matched')
else
console.log('not')
}
</script>
</head>
<body>
<div>
<input type="time" id="tt" value="17:22:22"/>
<input type="text" onkeypress="return myfun();" pattern="0 /^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$/" />
<input type="datetime-local">
<input type="text" placeholder="Enter Value" onkeypress="return checkText()" />
</div>
</body>
</html>