28번 개발일지(대구AI스쿨 63일차)

이혁진·2022년 6월 20일
0

대구AI스쿨

목록 보기
28/73

학습한 내용

jQuery 1일차. jdk, eclipse, tomcat, jquery를 다운받아서 사용했다.

학습소감

jQuery를 사용하면 JavaScript 코드를 간결하게 작성할 수 있다.

<body>
	<h1>JavaScript 실습</h1>
	<button onClick="set_h1()">h1 태그 문자열 변경</button>
</body>

JavaScript로 작성한 set_h1() 함수

		function set_h1() {
			let h1 = document.getElementsByTagName("h1");
			let str = h1[0].firstChild;
			str.nodeValue = "JavaScript로 문자열 변경";
        }

jQuery로 작성한 set_h1() 함수

		function set_h1() {
			$("h1").text("jQuery로 문자열 변경");
        }

eclipse에서 html 파일을 실행시키다가 아래 그림과 같은 에러가 발생했다.

이 에러가 발생하면 파일이 있는 프로젝트를 우클릭해서 Properties를 클릭하거나 Alt+Enter를 입력한다.

그러면 Server 탭이 있을텐데 여기서 <None>이 선택되어있을 것이다. 이걸 내가 사용하고자하는 서버로 선택한 후 Apply and Close를 하면 제대로 작동할 것이다.

profile
열정! 열정! 열정!

0개의 댓글