<html>
<head>
<title>자바스크립트 연습 </title>
<script>
finction change() {
var span = document.getElementById("myspan"); // id가 "myspan"인 DOM 객체 찾기
span.style.color="violet" ;
span.style.border = "2px dotted violet";</script>
</head>
<body>
<h3>자바스크립트란?
<input type="button" value="border" onclick="change()">
<button>p</button>
</h3>
<hr>
<p> 자바스크립트는 웹 프로그래밍 언어로서 웹 페이지를 동적 변경시킬 수 있다.</p>
<p><span id="mySpan">C 언어</span>를 아는 사용자는 빠르게 학습할 수 있다.</p>
<p><span id="mySpan">이벤트 등</span> GUI프로그래밍에 필요한 요소들이 있어 학습에 약간의 어려움이 있다.</p>
</body>
</html>
이건 제가한 실습입니다.
이거떔에 헤매다가 시간이다가서 어떻게해야할지모르겟네여 부탁드립니다.
1. finction -> function
2. 함수를 닫는 } 가 빠져 있네요. </script> 앞에 } 로 함수를 닫아주어야 해요.
3. 자바스크립트에는 대소문자를 구문하기 때문에 다음과 같이 수정하면 됩니다,
document.getElementById("myspan"); -> document.getElementById("mySpan");