ยซ   2025/02   ยป
์ผ ์›” ํ™” ์ˆ˜ ๋ชฉ ๊ธˆ ํ† 
1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28
Archives
Recent Posts
02-01 21:40

Today
Total

Recent Comments
๊ด€๋ฆฌ ๋ฉ”๋‰ด

์—ฐ์˜ ๊ธฐ๋ก ๐Ÿช

JavaScript ๋‚ด์šฉ์ •๋ฆฌ - 1 ๋ณธ๋ฌธ

WEB/HTML+CSS+JS

JavaScript ๋‚ด์šฉ์ •๋ฆฌ - 1

kite707 2021. 1. 1. 22:09

 

https://opentutorials.org/course/3085

 

WEB2 - JavaScript - ์ƒํ™œ์ฝ”๋”ฉ

์ˆ˜์—…์†Œ๊ฐœ ์ด ์ˆ˜์—…์€ https://opentutorials.org ๋ฅผ ๋งŒ๋“ค์–ด๊ฐ€๋ฉด์„œ JavaScript์— ๋Œ€ํ•œ ์ง€์‹๊ณผ ๊ฒฝํ—˜์„ ๋™์‹œ์— ์ฑ„์›Œ๋“œ๋ฆฌ๊ธฐ ์œ„ํ•œ ๋ชฉ์ ์œผ๋กœ ๋งŒ๋“ค์–ด์ง„ ์ˆ˜์—…์ž…๋‹ˆ๋‹ค.  ์ˆ˜์—…๋Œ€์ƒ ์ด ์ˆ˜์—…์€ ์›น ํŽ˜์ด์ง€๋ฅผ ์‚ฌ์šฉ์ž์™€ ์ƒ

opentutorials.org

์ž๋ฐ” ์Šคํฌ๋ฆฝํŠธ ๊ฐ•์˜๋Š” ์œ„ ๋งํฌ์—์„œ ๋ณผ ์ˆ˜ ์žˆ๋‹ค.

 

์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ๋ฅผ ์‚ฌ์šฉํ•˜๋ ค๋ฉด ๋‚ด์šฉ์„ <script></script>ํƒœ๊ทธ๋กœ ๊ฐ์‹ธ์ฃผ์–ด์•ผ ํ•œ๋‹ค.

๊ธ€์„ ์“ฐ๋ ค๋ฉด ์•„๋ž˜์™€ ๊ฐ™์ด ํ•œ๋‹ค.

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title></title>
  </head>
  <body>
    <script>
      document.write('hello world');
      document.write(1+1);
      </script>
      <h1>HTML</h1>
      <br>hello world</br>
      <br>1+1</br>
  </body>
</html>

์‹คํ–‰ํ™”๋ฉด์€ ์ด๋ ‡๊ฒŒ ๋‚˜์˜จ๋‹ค.

HTML์€ 1+1์„ ์ž…๋ ฅํ•˜๋ฉด ๊ทธ๋Œ€๋กœ ์ถœ๋ ฅํ•˜์ง€๋งŒ ์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ๋Š” ์ž๋™์œผ๋กœ 2๋ผ๊ณ  ๊ณ„์‚ฐํ•˜์—ฌ ์ถœ๋ ฅํ•œ๋‹ค.

 

์ด๋ฒคํŠธ 

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title></title>
  </head>
  <body>
    <input type="button" value="hi" onclick="alert('hi')">
  </body>
</html>

์ด๋ ‡๊ฒŒ ์œ„์™€ ๊ฐ™์ด ์›น ๋ธŒ๋ผ์šฐ์ €์—์„œ ํŠน์ •ํ•œ ์ผ์ด ๋ฐœ์ƒํ–ˆ์„ ๋•Œ ๊ทธ๊ฒƒ์„ ์ด๋ฒคํŠธ๋ผ๊ณ  ํ•œ๋‹ค. 

https://linuxism.ustd.ip.or.kr/1705

 

javascript - ์ด๋ฒคํŠธ ๋ฆฌ์ŠคํŠธ(event list)

onabort ์ด๋ฏธ์ง€์˜ ๋‹ค์šด๋กœ๋“œ๋ฅผ ์ค‘์ง€ํ•  ๋•Œ (๋ธŒ๋ผ์šฐ์ €์˜ ์ค‘์ง€๋ฒ„ํŠผ) onactivate ๊ฐœ์ฒด๊ฐ€ ํ™œ์„ฑํ™”๋  ๋•Œ ๋ฐœ์ƒ (ํƒœ๊ทธ์˜ ๊ธฐ๋Šฅ์ด ์ž‘์šฉํ•  ๋•Œ ๋ฐœ์ƒํ•˜๋Š” ์ด๋ฒคํŠธ๋กœ ์˜ˆ๋ฅผ ๋“ค์–ด ๋งํฌ๋ฅผ ๋ˆ„๋ฅผ ๊ฒฝ์šฐ ๋งํฌ๊ฐ€ ์˜ฎ๊ฒจ์งˆ๋•Œ ๋ฐœ์ƒ

linuxism.ustd.ip.or.kr

์œ„ ๋งํฌ์— ์ด๋ฒคํŠธ ๋ฆฌ์ŠคํŠธ๊ฐ€ ์ž˜ ์ •๋ฆฌ๋˜์–ด ์žˆ๋‹ค. ์‹ค์Šต์„ ์กฐ๊ธˆ ํ•ด๋ณด์ž.

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title></title>
  </head>
  <body>
    <input type="button" value="hi" onclick="alert('hi')">
    <input type="text" onchange="alert('changed')">
    <input type="text" onkeydown="alert('key down!')"
  </body>
</html>

input type="text"๋ฅผ ์ž…๋ ฅํ•˜๋ฉด ๊ธ€์ž๋ฅผ ์ž…๋ ฅํ•  ์ˆ˜ ์žˆ๋Š” ์ƒ์ž๊ฐ€ ์›นํŽ˜์ด์ง€์— ์ƒ๊ธด๋‹ค.

์—ฌ๊ธฐ์„œ onchange๋Š” ๊ฐ’์ด ๋ฌด์–ธ๊ฐ€ ๋ณ€ํ™”๊ฐ€ ์ƒ๊ธด ๋’ค ๋งˆ์šฐ์Šค ์ปค์„œ๊ฐ€ ์ƒ์ž ๋ฐ”๊นฅ์„ ํด๋ฆญํ•˜๊ฒŒ ๋˜๋ฉด ๋ฐ˜์‘ํ•œ๋‹ค. 

onkeydown์€ ํ‚ค๊ฐ€ ์ž…๋ ฅ๋˜๋ฉด ๋ฐ˜์‘ํ•œ๋‹ค.

 

์ฝ˜์†” 

์ด๋ฒˆ ์‹ค์Šต์€ ์ด ๋งํฌ์— ๋“ค์–ด๊ฐ€์„œ ์ง„ํ–‰ํ•  ์ˆ˜ ์žˆ๋‹ค.

https://web-n.github.io/web2_javascript/

 

WEB1 - Welcome

 

web-n.github.io

๋งํฌ์— ๋“ค์–ด๊ฐ€์„œ ๊ฐœ๋ฐœ์ž ๋„๊ตฌ๋ฅผ ์—ด๊ณ  ์•„๋ž˜ ์ฝ”๋“œ๋ฅผ ์ž…๋ ฅํ•ด๋ณด์ž.

alert('The World Wide Web (abbreviated WWW or the Web) is an information space 
where documents and other web resources are identified by Uniform Resource Locators (URLs), 
interlinked by hypertext links, and can be accessed via the Internet.[1] English scientist 
Tim Berners-Lee invented the World Wide Web in 1989. He wrote the first web browser computer 
program in 1990 while employed at CERN in Switzerland.[2][3] 
The Web browser was released outside of CERN in 1991, first to other research institutions 
starting in January 1991 and to the general public on the Internet in August 1991.'.length)

์ด๋ ‡๊ฒŒ ์ฝ˜์†”์ฐฝ์„ ์ด์šฉํ•ด ๊ธ€์ž์ˆ˜๋ฅผ ์…€ ์ˆ˜ ์žˆ๋‹ค. ๋˜ํ•œ ์˜์ƒ์„ ๋ณด๋ฉด ์ฝ˜์†”์ฐฝ์„ ์ด์šฉํ•ด ์ด๋ฒคํŠธ ๋‹น์ฒจ์ž๋ฅผ ์„ ์ •ํ•˜๊ธฐ๋„ ํ•˜๋Š” ๋“ฑ ๋ฌด๊ถ๋ฌด์ง„ํ•˜๊ฒŒ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋‹ค. ๋‚˜์ค‘์— ๊ณต๋ถ€๋ฅผ ํ•ด์„œ ๊ผญ ์จ๋จน์–ด ๋ณด๋„๋ก ํ•˜์ž.

 

'WEB > HTML+CSS+JS' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ๋‹ค๋ฅธ ๊ธ€

JavaScript ๋‚ด์šฉ์ •๋ฆฌ - 3  (0) 2021.01.03
JavaScript ๋‚ด์šฉ์ •๋ฆฌ - 2  (0) 2021.01.02
CSS ๋‚ด์šฉ์ •๋ฆฌ - ์„ ํƒ์ž  (0) 2020.12.31
CSS ๋‚ด์šฉ์ •๋ฆฌ - 4  (0) 2020.12.31
CSS ๋‚ด์šฉ์ •๋ฆฌ - 3  (0) 2020.12.30