강의

멘토링

커뮤니티

Inflearn Community Q&A

chzhair893429's profile image
chzhair893429

asked

2022 30-Minute Summary Course Season 1: HTML, CSS, Linux, Bootstrap, Python, JS, jQuery&Ajax

JavaScript Part 2 (Renewal)

20 분쯤에서 코드대로 했는데 왜 안되는걸까요ㅜ_ㅜ

Written on

·

222

0

jquery에서 버튼 누르면 함수가 실행되는

부분을 따라하려하다가 잘 안되서 질문 남겨봅니다.

이 코드대로 그대로 한거 같은데

왜 안되는걸까요

<!DCOTYPE HTML>
<HTML>
<HEAD>
    <title>Hello</title>
    <meta http-equiv="Content-type" content="text/html; charset=UTF-8"/>
</HEAD>
<BODY>
    <h1 id="one">hello world 1</h1>
    <h1 id="one">hello world 2</h1>
    <h1 id="one">hello world 3</h1>
    <h1 id="one">hello world 4</h1>
    <h1 id="one">hello world 5</h1>
    <h1 id="one">hello world 6</h1>
    <button id="two" onclick="f()"> 눌러주세요 </button>


    <script src="https://code.jquery.com/jquery-3.6.0.slim.min.js" 
            integrity="sha256-u7e5khyithlIdTpu22PHhENmPcRdFiHRjhAuHcs05RI=" 
            crossorigin="anonymous"></script>
    <script>
    $('#two').click(
        function f(){
        $('h1:odd').click('반갑습니다 :)').css("background-color","skyblue");
        }
        );
    </script>
</BODY>
</HTML>

button을누르면동작하는거javascriptHTML/CSSpython

Answer

This question is waiting for answers
Be the first to answer!
chzhair893429's profile image
chzhair893429

asked

Ask a question