Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
- </head>
- <body>
- <center><h1>Our jQuery examples</h1></center><hr/>
- <script>
- /*
- $(selector).action()
- $ sign - access jquery
- a (selector) to query find html elemens (can be id or class or tag)
- jQuery action() - what to do we event is fired
- */
- $(document).ready(function(){
- //$("#jordan").hide()
- //$("div:first").hide();
- $(".nick").click(function(){
- $(this).hide();
- });
- $("#jordan").mouseenter(function(){
- alert ("you cant touch this!!");
- });
- });
- /* events
- mouse events - click, dblclick, mouseenter, mouseleave
- keyboard events - keypress, keydown, keyup
- form events - submit, change, focus, blur
- Document/window events - ready, load, resize, scroll, unload
- */
- </script>
- <div>
- <center><h1>Welcome to hackerU</h1></center>
- </div>
- <div id="jordan">
- <center><h1>Jordan the king</h1></center>
- </div>
- <div class="nick">
- <center><h1>Nick the naknik</h1></center>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement