Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8" />
- <title></title>
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
- </head>
- <body>
- <p>Hi I'm learning jQuery</p>
- <p>Second paragraph</p>
- <button id="btnChange">Change Content</button>
- <script>
- $(document).ready(function () { // wait for webpage finished loading (ready)
- $("#btnChange").click(function () {
- $("p").html("New content here");
- $("p:first").css("color", "red");
- });
- });
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement