흐림 이벤트는 개체가 초점을 잃을 때 트리거됩니다. 다음 코드를 실행하여 JavaScript에서 onblur 이벤트를 구현하는 방법을 배울 수 있습니다.
예시
<!DOCTYPE html>
<html>
<body>
<p>Write below:</p>
<input type = "text" onblur = "newFunc(this)">
<script>
function newFunc(a) {
a.style.background = "green";
}
</script>
</body>
</html>