[1] 03/15 ubuntu자바스크립트 웹사이트 연습

Noh Sinyoung·2023년 3월 15일
0

index

<!DOCTYPE html>
<html lang="en">
<head>
    <title>나의 홈페이지</title>
    <link href="./css/practice.css" rel="stylesheet" type="text/css">

    <script type="text/javascript">
        function doSomething(){
            let a = document.getElementById('inputA').value;
            let b = document.getElementById('inputB').value;
            document.getElementById("valueA").innerHTML = a;
            document.getElementById("valueB").innerHTML = b;
            document.getElementById("valueC").innerHTML = Number(a) + Number(b);
        }

        function whatTimeIsIt(){
            alert(new Date());
        }
    </script>


</head>
<body>
    <nav>
        <a href="./index.html">Home</a>
        <a href="./blog_list.html">Blog</a>
        <a href="./about_me.html">About Me</a>
    </nav>

    <h1>첫번째 크기 헤드라인</h1>
    <h2>두번째 크기 헤드라인</h2>
    <h3>세번째 크기 헤드라인</h3>
    <h4>네번째 크기 헤드라인</h4>
    <h5>다섯번째 크기 헤드라인</h5>

    <button onclick="whatTimeIsIt()">현재시간</button>
    <hr />

    <label for="inputA">a</label>
    <input id="inputA" value=1 onkeyup="doSomething()">
    <label for="inputB">b</label>
    <input id="inputB" value=2 onkeyup="doSomething()">

    <p><span id="valueA">1</span> + <span id="valueB">2</span> = <span id="valueC">3</span>입니다.</p>




    <p>문단은 p로 쓰세요. p는 아마도 Paragraph의 앞 자를 따 온 것이겠죠?</p>
    <a href="https://www.google.com">Go to google</a>
    <hr>
    <img src="./images/stay_funky.jpg" width="600px" alt="">
</body>
</html>

==========================================================================

blog_list

<!DOCTYPE html>
<html lang="en">
    <head>
        <title>About me</title>
        <link href="./css/practice.css" rel="stylesheet" type="text/css" href="">
        <style>
        nav {background-color: darkgreen; font-size: 150%; text-align: center;}
        nav a {color:gold}
        </style>
    </head>
    <body>
        <nav>
            <a href="./index.html">Home</a>
            <a href="./blog_list.html">Blog</a>
            <a href="./about_me.html">About Me</a>
        </nav>

        <h1>Blog</h1>
        <p>아직 작성하지 않았습니다.</p>
    </body>
</html>

=======================================================================

about_me

<!DOCTYPE html>
<html lang="en">
<head> 
    <title>About me</title>
    <link href="./css/practice.css" rel="stylesheet" type="text/css" href="">
    <script type="text/javascript" src="./script/what_time_is_it.js"></script>
    <style>
        nav {background-color: darkgreen; font-size: 150%; text-align: center;}
        nav a {color:gold}
    </style>
</head>
<body>
    <nav>
        <a href="./index.html">Home</a>
        <a href="./blog_list.html">Blog</a>
        <a href="./about_me.html">About Me</a>
    </nav>

    <h1>about Me</h1>
    <h2>종로산업정보학교 노신영입니다.</h2>
    <p>종로산업정보학교 인공지능컴퓨터과 수업</p>

    <button onclick="whatTimeIsIt()">현재시간</button>
    <hr />

    <a href="index.html">첫 화면으로 가기</a>
    <img src="./images/child_01.jpg" height="400px" alt="">


</body>
</html>

====================================================================

what_time_is_it

function whatTimeIsIt(){
    alert(new Date());
}

=====================================================================

add_two_numbers

function doSomething(){
    let a = document.getElementById('inputA').value;
    let b = document.getElementById('inputB').value;
    document.getElementById("valueA").innerHTML = a;
    document.getElementById("valueB").innerHTML = b;
    document.getElementById("valueC").innerHTML = Number(a) + Number(b);
}

0개의 댓글