내부에 사용이 내 자바 스크립트 코드자바 스크립트 : 변수 외부 기능을 초기화 기능
var helper = document.getElementById("helper");
helper.style.position = "relative";
helper.style.width = "50px";
helper.style.height = "50px";
helper.style.border = "1px solid #000";
function move() {
helper.style.left = event.offsetX + "px";
helper.style.top = event.offsetY + "px";
}
내 HTML 코드
<div id="grid" onmousemove="move()" onmousedown="down()">
<div id="helper"></div>
</div>
입니다하지만 호출 할 때 그 기능 아무 일도 일어나지 않습니다. 나는 양방향 세계 및 모든 것에 변수 도우미 그래서 기능이 가이 helper
변수에 대한 액세스 권한을 가지고
[jQuery 또는 \ getElementById \와 같은 DOM 메소드가 요소를 찾을 수없는 이유는 무엇입니까?] (http://stackoverflow.com/questions/14028959/why-does-jquery-or-a-) dom-method-such-getelementbyid-not-find-the-element) – Bergi