onblur 사용 속성은 요소가 HTML에서 포커스를 잃을 때 스크립트를 실행합니다. 다음 코드를 실행하여 onblur를 구현할 수 있습니다. 속성 -
예시
<!DOCTYPE html>
<html>
<body>
<p>Type text below!</p>
Country: <input type = "text" name = "myid" id = "myid" onblur = "display()">
<script>
function display() {
var str = document.getElementById("myid");
str.value = str.value.toUpperCase();
}
</script>
</body>
</html>