Bibi's DevLog ๐Ÿค“๐ŸŽ

[์ธํ”„๋Ÿฐ]Javascript์ž…๋ฌธ - ๊ณ„์‚ฐ๊ธฐ ๊ตฌํ˜„(๋ฌธ์ž์—ด ๊ณ„์‚ฐ๊ธฐ ์‹œ์ž‘, ์‚ฌ์น™์—ฐ์‚ฐ ๊ณ„์‚ฐ ๋ฐ ์ถœ๋ ฅ, ) ๋ณธ๋ฌธ

ํ”„๋กœ๊ทธ๋ž˜๋ฐ/Javascript ์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ

[์ธํ”„๋Ÿฐ]Javascript์ž…๋ฌธ - ๊ณ„์‚ฐ๊ธฐ ๊ตฌํ˜„(๋ฌธ์ž์—ด ๊ณ„์‚ฐ๊ธฐ ์‹œ์ž‘, ์‚ฌ์น™์—ฐ์‚ฐ ๊ณ„์‚ฐ ๋ฐ ์ถœ๋ ฅ, )

๋น„๋น„ bibi 2020. 10. 26. 16:16
* ์ด ๊ธ€์€ ์ธํ”„๋Ÿฐ์—์„œ ์ œ๊ณตํ•˜๋Š” ํ˜ธ๋ˆ…์Šค๋‹˜์˜ ์œ ๋ฃŒ ๊ฐ•์˜ '์‰ฝ๊ณ  ์ž์—ฐ์Šค๋Ÿฝ๊ฒŒ ๋ฐฐ์›Œ๋ณด๋Š” Javascript ์ž…๋ฌธ - ์ฝ”๋“œ์Šค์ฟผ๋“œ ๋งˆ์Šคํ„ฐ์ฆˆ ์ฝ”์Šค ๋ ˆ๋ฒจ1'๋ฅผ ๋“ฃ๊ณ  ๊ณต๋ถ€ํ•˜๋ฉฐ ์ •๋ฆฌํ•œ ๊ธ€์ž…๋‹ˆ๋‹ค. ๊ฐ•์˜ ๋‚ด์šฉ์— ๋”ํ•ด, ์ œ๊ฐ€ ํ•„๊ธฐํ•˜๊ณ  ๊ตฌ๊ธ€๋งํ•œ ๋‚ด์šฉ์ด ์ •๋ฆฌ๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค. ์ดˆ๋ณด์ธ ์ œ๊ฐ€ ์ดํ•ดํ•œ ๋Œ€๋กœ ์ •๋ฆฌํ–ˆ๊ธฐ ๋•Œ๋ฌธ์—, ๋ถ€์ •ํ™•ํ•œ ๋‚ด์šฉ์ด ์žˆ์„ ์ˆ˜ ์žˆ์Œ์„ ๊ฐ์•ˆํ•ด ์ฃผ์‹œ๊ธธ ๋ฐ”๋ž๋‹ˆ๋‹ค. ๊ฐ•์˜๋ฅผ ๋“ฃ๊ณ  ๋‚ด์šฉ์„ ์ •๋ฆฌํ•œ ๊ธ€์ด๊ธฐ ๋•Œ๋ฌธ์— ๋ฌธ์ œ๊ฐ€ ๋˜์ง€ ์•Š๋Š”๋‹ค๋Š” ์ธํ”„๋Ÿฐ ์ธก ๋‹ต๋ณ€์„ ๋ฐ›์€ ์ ์ด ์žˆ์œผ๋‚˜(https://bibi6666667.tistory.com/37), ์ €์ž‘๊ถŒ์ƒ ๋ฌธ์ œ๊ฐ€ ๋œ๋‹ค๋ฉด ๋ณดํ˜ธ ๋ชจ๋“œ(๋น„๊ณต๊ฐœ)๋กœ ์ „ํ™˜ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.

 

[์‹ค์Šต] ๊ณ„์‚ฐ๊ธฐ ๊ตฌํ˜„ํ•˜๊ธฐ

์ด๋ฒˆ ์‹ค์Šต์„ ํ†ตํ•ด ๊ณ„์‚ฐ๊ธฐ๋ฅผ ๊ตฌํ˜„ํ•ด ๋ณผ ๊ฒƒ์ด๋‹ค.

 


๋ฌธ์ž์—ด ๊ณ„์‚ฐ๊ธฐ ์‹œ์ž‘

 

์‹œ์ž‘ํ•˜๊ธฐ

  • ๊ณ„์‚ฐ๊ธฐ ํ”„๋กœ๊ทธ๋ž˜๋ฐ์— ๋Œ€ํ•œ ์š”๊ตฌ์‚ฌํ•ญ
  • ๊ณ„์‚ฐ๊ธฐ ๊ตฌํ˜„์„ ํ†ตํ•ด ๊ฒฝํ—˜ํ•˜๊ฒŒ ๋  ๋‚ด์šฉ

์š”๊ตฌ์‚ฌํ•ญ

  • ์‚ฌ์šฉ์ž๊ฐ€ ์ž…๋ ฅํ•œ ๊ฐ’์— ๋”ฐ๋ผ ์‚ฌ์น™์—ฐ์‚ฐ์„ ๊ณ„์‚ฐํ•  ์ˆ˜ ์žˆ๋Š” ๊ณ„์‚ฐ๊ธฐ๋ฅผ ๊ตฌํ˜„ํ•œ๋‹ค.
    • ์˜ˆ๋ฅผ ๋“ค์–ด "2 + 3 * 4 / 2"์™€ ๊ฐ™์€ ์ˆœ์„œ๋กœ ๊ฐ’์„ ์ž…๋ ฅํ•˜๋Š” ๊ฒฝ์šฐ ์‹คํ–‰ ๊ฒฐ๊ณผ ๊ฐ’์ธ 10์„ ์ถœ๋ ฅํ•ด์•ผ ํ•œ๋‹ค.
      (์‚ฌ์น™์—ฐ์‚ฐ ์šฐ์„ ์ˆœ์œ„์™€ ์ƒ๊ด€์—†์ด, ์šฐ์„ ์€ ์•ž->๋’ค ์ˆœ์„œ๋Œ€๋กœ ๊ณ„์‚ฐํ•˜๋Š” ํ”„๋กœ๊ทธ๋žจ ๋งŒ๋“ค ๊ฒƒ)
  • ์‚ฌ์šฉ์ž๊ฐ€ ์ž…๋ ฅํ•  ์ˆ˜ ์žˆ๋Š” ๊ฐ’์˜ ์ˆ˜๋Š” ์ œํ•œ๋˜์–ด ์žˆ์ง€ ์•Š๋‹ค.
  • ๋‚˜๋ˆ—์…ˆ์˜ ๊ฒฐ๊ณผ ๊ฐ’์€ ์ •์ˆ˜๋กœ ๊ฐ’์ด ๋–จ์–ด์ง€์ง€ ์•Š๋”๋ผ๋„ ์ •์ˆ˜ ๊ฐ’๋งŒ ์‚ฌ์šฉํ•˜๋Š” ๊ฒƒ์œผ๋กœ ํ•œ๋‹ค.

๊ณ„์‚ฐ๊ธฐ ๊ตฌํ˜„์„ ํ†ตํ•ด์„œ ๋ญ˜ ๊ฒฝํ—˜ํ•˜๊ฒŒ ๋˜๋Š”๊ฐ€?

  • ๊ณ„์‚ฐ๊ธฐ ํ”„๋กœ๊ทธ๋žจ์„ ๊ตฌํ˜„ํ•˜๊ณ  ์‹คํ–‰ํ•˜๋Š” ๋ฐฉ๋ฒ•
  • ์‚ฌ์šฉ์ž ๊ฐ’์„ ์ž…๋ ฅ๋ฐ›๋Š” ๋ฐฉ๋ฒ•(input)
  • ๊ณ„์‚ฐ ๊ฒฐ๊ณผ๋ฅผ HTML์— ์ถœ๋ ฅํ•˜๋Š” ๋ฐฉ๋ฒ•(output)
  • ๋ณ€์ˆ˜, ๋ฐ์ดํ„ฐ ํƒ€์ž…, ๋ฐ˜๋ณต๋ฌธ, ์กฐ๊ฑด๋ฌธ์„ ์‚ฌ์šฉํ•˜๋Š” ๋ฐฉ๋ฒ•
  • ํ•จ์ˆ˜, ๋ฐฐ์—ด, ๋ฉ”์†Œ๋“œ, ํด๋ž˜์Šค๋ฅผ ํ™œ์šฉํ•ด ํ”„๋กœ๊ทธ๋ž˜๋ฐํ•˜๋Š” ๋ฐฉ๋ฒ•

๋ผ์ด๋ธŒ ์ฝ”๋”ฉ ์†Œ์Šค ์ €์žฅ์†Œ(ํ•ด์„ค)

https://github.com/honux77/js-playground ๋ฏธ๋ฆฌ ๋ณด์ง€ ๋ง๊ณ  ๋จผ์ € ํ’€๊ณ  ๋‚˜์„œ ๋ณผ ๊ฒƒ์„ ๊ถŒ์žฅํ•œ๋‹ค.

 

honux77/js-playground

์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ ํ”Œ๋ ˆ์ด๊ทธ๋ผ์šด๋“œ ๊ณต๋ถ€์šฉ . Contribute to honux77/js-playground development by creating an account on GitHub.

github.com

 


์‚ฌ์น™์—ฐ์‚ฐ ๊ณ„์‚ฐ ๋ฐ ์ถœ๋ ฅ

 

ํ•™์Šต ๋ชฉํ‘œ

  • ๊ฐ„๋‹จํ•œ ๊ฐœ๋ฐœ ํ™˜๊ฒฝ์„ ๊ตฌ์ถ•์„ ๊ฒฝํ—˜ํ•œ๋‹ค.
  • ํ”„๋กœ๊ทธ๋žจ์„ ์‹คํ–‰ํ•˜๊ณ  ๋ธŒ๋ผ์šฐ์ ธ์—์„œ ๊ฐ’์ด ์ถœ๋ ฅ๋˜๋Š” ๊ฒƒ์„ ๊ฒฝํ—˜ํ•œ๋‹ค.

์š”๊ตฌ์‚ฌํ•ญ

  • calculator.html ์„ ๋งŒ๋“ ๋‹ค.
  • main() ํ•จ์ˆ˜๋ฅผ ๋งŒ๋“ค๊ณ  ํ˜ธ์ถœํ•œ๋‹ค.
  • ์•„๋ฌด ๊ฐ’์ด๋‚˜ ์‚ฌ์น™์—ฐ์‚ฐ(๋ง์…ˆ, ๋บ„์…ˆ, ๊ณฑ์…ˆ, ๋‚˜๋ˆ—์…ˆ)์„ ํ†ตํ•ด ๊ณ„์‚ฐํ•œ ๊ฒฐ๊ณผ ๊ฐ’์„ ์ถœ๋ ฅํ•˜๋Š” ํ”„๋กœ๊ทธ๋žจ์„ ๊ตฌํ˜„ํ•œ๋‹ค.
  • ๊ตฌํ˜„ํ•œ ํ”„๋กœ์ ํŠธ๋ฅผ github์— ํ‘ธ์‹œํ•œ๋‹ค.

ํžŒํŠธ

  • ๋ง์…ˆ = +, ๋บ„์…ˆ = -, ๊ณฑ์…ˆ = *, ๋‚˜๋ˆ—์…ˆ = / ์œผ๋กœ ๊ตฌํ˜„ํ•œ๋‹ค.

 


 

๋‚˜์˜ ๋‹ต์•ˆ (๋ฌธ์ž์—ด ๊ณ„์‚ฐ๊ธฐ)

- ๋™์ž‘์€ ํ•œ๋‹ค!
- ์˜ค๋ฅ˜ ๋ฐœ๊ฒฌ : ํ•œ ์ž๋ฆฌ ์ˆซ์ž๋งŒ ๊ณ„์‚ฐ ๊ฐ€๋Šฅ..ใ… ใ… 

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
        var arr = [];
        var numArr = [];
        var symArr = [];
        var result = 0;

        var main = function () {
            var input = document.getElementById("input").value;
            arr = input.split("");
            console.log("arr๋ฐฐ์—ด : " + arr);
            classify();
        }

        var classify = function(){
            for (var i = 0; i < arr.length; i++) {
                if (isNaN(Number(arr[i])) === true) {
                    symArr.push(arr[i]);
                } else {
                    numArr.push(arr[i]);
                }
            }
            calculate();
        }

        var calculate = function(){
            result = numArr[0];
            console.log(result);
            for (var j = 0; j < numArr.length-1; j++) {
                if (symArr[j] === "+"){
                    result = Number(result) + Number(numArr[j+1]);
                };
                if (symArr[j] === "-"){
                    result = Number(result) - Number(numArr[j+1]);
                };
                if (symArr[j] === "*"){
                    result = Number(result) * Number(numArr[j+1]);
                };
                if (symArr[j] === "/"){
                    result = Number(result) / Number(numArr[j+1]);
                };
                console.log(j, result);
            }
            // 5+4-3*2/1 ๊ณ„์‚ฐํ•˜๊ธฐ.
            // 5+4 = 9 numArr[0] symArr[0] numArr[1]
            // 9-3 = 6 result symArr[1] numArr[2]
            // 6*2 = 12 result symArr[2] numArr[3]
            // 12/1 = 12 result symArr[3] numArr[4]
            // numArr 0๋ฒˆ์งธ symArr0๋ฒˆ์งธ numArr1๋ฒˆ์จฐ
            //์œ„์˜ ๊ฒฐ๊ณผ๊ฐ’ symArr1๋ฒˆ์งธ numArr2๋ฒˆ์งธ
            //์œ„์˜ ๊ฒฐ๊ณผ๊ฐ’ symArr2๋ฒˆ์งธ numArr3๋ฒˆ์งธ
            //..
            print();
        }

        var print = function () {
            var resultP = document.getElementById("result");
            resultP.innerHTML = "๊ณ„์‚ฐ๊ฒฐ๊ณผ : " + result;
        }

        main();


    </script>
</head>
<body>
<h1> ๊ณ„์‚ฐ๊ธฐ ํ”„๋กœ๊ทธ๋žจ 1 </h1>
๊ณ„์‚ฐ์‹์„ ์ž…๋ ฅํ•˜์„ธ์š”.<br>
- ๋”ํ•˜๊ธฐ๋Š” +, ๋นผ๊ธฐ๋Š” -, ๊ณฑํ•˜๊ธฐ๋Š” *, ๋‚˜๋ˆ„๊ธฐ๋Š” /๋กœ ์ž…๋ ฅ<br>
- ๊ณ„์‚ฐ์‹์˜ ์•ž๋ถ€ํ„ฐ ์ˆœ์„œ๋Œ€๋กœ ๊ณ„์‚ฐํ•ฉ๋‹ˆ๋‹ค. <br>
<input type="text" id="input">
<button onclick="main()">๊ณ„์‚ฐํ•˜๊ธฐ</button>
<p id="result"></p>
</body>
</html>

 

 

ํ•ด์„ค(์ •๋‹ต ์ฝ”๋“œ)

๋„ˆ๋ฌด ๊ฐ„๋‹จํ•ด์„œ ๋†€๋ž๋‹ค.. ๊ทธ๋ƒฅ ์ž„์˜์˜ ๊ฐ’์„ +-*/ ํ•ด์„œ ์ฝ˜์†”์ฐฝ์— ์ฐ์œผ๋ฉด ๋˜๋Š” ๊ฑฐ์˜€์Œ!
(๋‚ด๊ฐ€ ๋งŒ๋“ ๊ฑด ์ตœ์ข… ๋ฌธ์ œ์˜€๋‹ค)
- ์‚ฌ์น™์—ฐ์‚ฐ ๊ณ„์‚ฐ๊ธฐ ์ฝ”๋“œ

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<h1>๋ฌธ์ž์—ด ๊ณ„์‚ฐ๊ธฐ ๊ตฌํ˜„ํ•˜๊ธฐ</h1>
<div id="output"></div>
<script>
    function main() {
        console.log("Calculator1");
        var out = document.getElementById("output"); // <div> ๊ฐ์ฒด ๊ฐ€์ ธ์˜ค๊ธฐ
        out.innerHTML = "๊ณ„์‚ฐ๊ธฐ ๊ตฌํ˜„ํ•˜๊ธฐ";
        console.log(10+3);
        console.log(10-3);
        console.log(10*3);
        console.log(10/3);
    }
    main();
</script>
</body>
</html>

 

 

 


๊ฐ’ ์ž…๋ ฅ ๋ฐ ์‚ฌ์น™์—ฐ์‚ฐ - ๋ณ€์ˆ˜

ํ•™์Šต ๋ชฉํ‘œ

  • ์‚ฌ์šฉ์ž๊ฐ€ ๊ฐ’์„ ์ž…๋ ฅํ•˜๋Š” ๊ฒฝํ—˜์„ ํ•œ๋‹ค.
  • ํ”„๋กœ๊ทธ๋ž˜๋ฐ์—์„œ ๋ณ€์ˆ˜๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ๊ฒฝํ—˜์„ ํ•œ๋‹ค.

์š”๊ตฌ์‚ฌํ•ญ

  • ์‚ฌ์šฉ์ž๋กœ๋ถ€ํ„ฐ 2๊ฐœ์˜ ์ˆซ์ž ๊ฐ’์„ ์ž…๋ ฅ ๋ฐ›์€ ํ›„ 2๊ฐœ์˜ ์ˆซ์ž ๊ฐ’์„ ํ™œ์šฉํ•ด ์‚ฌ์น™์—ฐ์‚ฐ์„ ๊ณ„์‚ฐํ•œ๋‹ค.
  • ๊ณ„์‚ฐํ•œ ๊ฒฐ๊ณผ ๊ฐ’์„ ํ™”๋ฉด์— ์ถœ๋ ฅํ•œ๋‹ค.

ํžŒํŠธ

  • ์‚ฌ์šฉ์ž์—๊ฒŒ ์ˆซ์ž ๊ฐ’์„ ์ž…๋ ฅ ๋ฐ›๋Š” ๋ฐฉ๋ฒ•์€ prompt() ๋˜๋Š” html input ๊ฐ์ฒด๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ๋ฐฉ๋ฒ•์ด ์žˆ๋‹ค.
  • ๊ฐ€๋Šฅํ•˜๋ฉด input ํƒœ๊ทธ๋ฅผ ์‚ฌ์šฉํ•ด ๋ณด์ž.

๋‚ด๊ฐ€ ์ง  ์ฝ”๋“œ

- ์ž˜ ๋™์ž‘ํ•œ๋‹ค! :D

๐Ÿ”ค ์˜๋‹จ์–ด
- ๋”ํ•˜๋‹ค : add, ๋นผ๋‹ค : subtract, ๊ณฑํ•˜๋‹ค : multiply, ๋‚˜๋ˆ„๋‹ค : divide
- (๋ฐฉ์ •์‹ ์ฝ์„ ๋•Œ) + : plus, - : minus, * : time, / : divided by
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<h1>๊ณ„์‚ฐ๊ธฐ-๊ฐ’ ์ž…๋ ฅ ๋ฐ ์‚ฌ์น™์—ฐ์‚ฐ(๋ณ€์ˆ˜)</h1>
<ul>
    <li>์‚ฌ์šฉ์ž๋กœ๋ถ€ํ„ฐ 2๊ฐœ์˜ ์ˆซ์ž ๊ฐ’์„ ์ž…๋ ฅ ๋ฐ›์€ ํ›„ 2๊ฐœ์˜ ์ˆซ์ž ๊ฐ’์„ ํ™œ์šฉํ•ด ์‚ฌ์น™์—ฐ์‚ฐ์„ ๊ณ„์‚ฐํ•œ๋‹ค.</li>
    <li>๊ณ„์‚ฐํ•œ ๊ฒฐ๊ณผ ๊ฐ’์„ ํ™”๋ฉด์— ์ถœ๋ ฅํ•œ๋‹ค.</li>
</ul>
- ์ž„์˜์˜ ์ˆซ์ž X์™€ Y๋ฅผ ์ž…๋ ฅํ•ด ์ฃผ์„ธ์š”.<br>
- ์›ํ•˜๋Š” ๋ฒ„ํŠผ์„ ๋ˆ„๋ฅด๋ฉด ์‚ฌ์น™์—ฐ์‚ฐ์„ ํ•ด ๋“œ๋ฆฝ๋‹ˆ๋‹ค.<br>
X = <input type="number" id="inputX"> <br>
Y = <input type="number" id="inputY"> <br>
X๋ฅผ Y๋กœ.. <br>
<button onclick="plus()">๋”ํ•˜๊ธฐ</button>
<button onclick="minus()">๋นผ๊ธฐ</button>
<button onclick="times()">๊ณฑํ•˜๊ธฐ</button>
<button onclick="divide()">๋‚˜๋ˆ„๊ธฐ</button> <br>
๊ณ„์‚ฐ ๊ฒฐ๊ณผ : <span id="result"></span>

<script>
function plus() {
    var X = Number(document.getElementById("inputX").value);
    var Y = Number(document.getElementById("inputY").value);
    var result = document.getElementById("result");
    result.innerHTML = X + Y;
}

function minus() {
    var X = Number(document.getElementById("inputX").value);
    var Y = Number(document.getElementById("inputY").value);
    var result = document.getElementById("result");
    result.innerHTML = X - Y;
}

function times() {
    var X = Number(document.getElementById("inputX").value);
    var Y = Number(document.getElementById("inputY").value);
    var result = document.getElementById("result");
    result.innerHTML = X * Y;
}

function divide() {
    var X = Number(document.getElementById("inputX").value);
    var Y = Number(document.getElementById("inputY").value);
    var result = document.getElementById("result");
    result.innerHTML = X / Y;
}
</script>
</body>
</html>

 

 

์ •๋‹ต ์ฝ”๋“œ

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<h1>๋ฌธ์ž์—ด ๊ณ„์‚ฐ๊ธฐ ๊ตฌํ˜„ํ•˜๊ธฐ</h1>
<div>
    ์ฒซ ๋ฒˆ์งธ ์ˆ˜ : <input type="text" id="n1"><br>
    ๋‘ ๋ฒˆ์งธ ์ˆ˜ : <input type="text" id="n2"><br>
    <button onclick="calc()">์‹คํ–‰</button>
</div>
<div id="output">์—ฌ๊ธฐ์— ๊ฒฐ๊ณผ๊ฐ€ ๋“ค์–ด๊ฐ‘๋‹ˆ๋‹ค.</div>
<script>
    function calc(){
        var str1 = document.getElementById("n1").value;
        var str2 = document.getElementById("n2").value;
        var n1 = Number(str1);
        var n2 = Number(str2);

        var out = document.getElementById("output");
        var str = "";
        str += "๋”ํ•˜๊ธฐ : " + (n1 + n2) + "<br>";
        str += "๋นผ๊ธฐ : " + (n1 - n2) + "<br>";
        str += "๊ณฑํ•˜๊ธฐ : " + (n1 * n2) + "<br>";
        str += "๋‚˜๋ˆ„๊ธฐ : " + (n1 / n2) + "<br>";

        out.innerHTML = str;
    }

</script>
</body>
</html>
document.getElementById("ABC").innerHTML = "๋ฌธ์„œ์— ์ ๊ธฐ";
- document : ํ•ด๋‹น ์›น๋ฌธ์„œ๋ฅผ ๊ฐ€๋ฆฌํ‚ด
- getElementById("ABC") : id๊ฐ’์ด "ABC"์ธ element(์š”์†Œ)๋ฅผ ๊ฐ€์ ธ์˜ค๊ธฐ. (์•„๋ž˜์—์„  div ๊ฐ์ฒด)
- .innerHTML : ์ด ๊ฐ์ฒด์˜  ์†์„ฑ์˜ ๊ฐ’์„
- = "๋ฌธ์„œ์— ์ ๊ธฐ" : "๋ฌธ์„œ์— ์ ๊ธฐ"๋กœ ๋ฐ”๊ฟ”๋ผ.

-> Javascript๋Š” HTML์„ ๊ฐ์ฒด๋กœ ์ทจ๊ธ‰ํ•˜์—ฌ, HTML์„ ์ œ์–ดํ•˜๊ธฐ ์œ„ํ•ด ๋งŒ๋“ค์–ด์ง„ ์–ธ์–ด์ด๋‹ค !!!