script common
https://www.w3schools.com/css/tryit.asp?filename=trycss_default
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="mystyle.css">
</head>
<body>
<input type="text" id="txt" onkeypress="test()">
</body>
<script type="text/javascript" src="https://cdn.jsdelivr.net/jquery/latest/jquery.min.js"></script>
<script>
$(document).ready(function(){
});
function test()
{
var hasFocus = $('#txt').is(':focus');
if(hasFocus){
alert("ok");
}else{
alert("failed");
}
}
</script>
</html>
script common
Reviewed by Leo
on
Mei 08, 2022
Rating:
Tidak ada komentar