Java Script & DOM/Java Script 36

이벤트와 함수를 연결할 때 'this'를 인자를 주는 방법

이벤트와 자바스크립트 함수를 연결할 때 함수의 인자를 'this'를 사용하면 이벤트가 발생한 노드를 전달한다. 태그 이벤트와 함수를 연결할 때 함수의 인자로 'this'를 준다. <a onclikc="testSelf(this)">자신을 전달하는 노드</a> 스크립트 함수는 아래와 같다. function testSelf( obj ) { var txt = obj.innerHTML; al..

방문자의 브라우저 스크린의 정보 탐색: screen 객체

방문자의 브라우저의 스크린 정보를 확인하기 위한 객체로 screen 객체가 있다. document.write("Total width/height: "); document.write(screen.width + "*" + screen.height); document.write("<br />"); document.write("Available width/height: "); document.write(screen.availWidth + "*" + screen.availHeight); document.write("<br />"); document.write("Color depth: ")..