JavaScript 주석문
한줄 주석 //
여러줄 주석 /* ~ */
( HTML 주석문 <!-- ~ --> , CSS 주석문 // , /* ~ */ 한줄이나 여러줄이나 같이 사용 )
alert() 웹 페이지를 띄우면, 알림창으로 뜬다.
내부 스타일 안먹힘
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>alert()</title>
<style>
p {background-color : yellow; border : solid 3px red;
color : blue;}
</style>
<script>
/* alert()는 괄호 안의 내용을 알림 창 형식으로 화면에 출력 */
alert("안녕하세요"); // '안녕하세요'를 화면에 출력
document.write("<p>모두 안녕</P>");
</script>
</head>
<body>
<h2>글 제목</h2>
<script>
document.write("<p style={{font-weight:bold;}}>단락입니다.</p>");
</script>
</body>
</html>
| 형변환 및 예제 (0) | 2022.06.30 |
|---|---|
| 연산자 (Arithmetic, Assignment, String, Comparison, Logical) (0) | 2022.06.28 |
| 변수 Variable / 출력 (0) | 2022.06.28 |
| 기계어로 번역 방식 / 컴파일(compile), 인터프리터(interpreter) (0) | 2022.06.28 |
| JavaScript 개념 / 불켜기 불끄기 (0) | 2022.06.28 |