버튼을 클릭 할 때 div의 위치를 이동하려고하지만 작동하지 않습니다.div를 사용하여 버튼으로 div 위치 변경 JS
<script>
function changePosition1() {
document.getElementsByTagName("div").style.top="300px";
}
</script>
<button type="button" onclick="changePosition1()">click me</button>
<div style="position: absolute; height:100px; width:100px; background-color: green;"></div>
당신은 아주 많이 선생님입니다. –