NEWS: Total Picture Views: 147066 | Total Article Views: 155642 | Top 5 Most Popular Article: 1. Am I Stuck Algorithm with Becker Robot | 2. How to read a JSON and work with it | 3. PickUpThings with Becker Robot | 4. Encrypted Data GUI (Download .Zip) | 5. Create Wall and Things with Becker

JQuery On Click Hide Example Javascript

Description:

In this example I will be showing how to use JQuery with click function.

Code:

<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>JQuery Programming</title>

    <script src="//jmdev.ca/sheridan/js/jquery-1.11.0.min.js"></script>
    <script type="text/javascript">
        $(document).ready(function(){
            $("h1").css("background","red").css("color","yellow");

            $("h2,h1").click(function(){
                $(this).hide();
            });
        });
    </script>
</head>
<body>
    <h1>This is heading 1</h1>
    <h2>This is heading 2</h2>
</body>
</html>
Attachments: None

Tags: JQuery onClick Hide

Total Views: 777

My name is Jean-Mathieu

I created this website so other people could enjoy finding useful stuff easier. If you have any question do not hesitate to contact me.

jean8mathieuCreated on 02/23/15 and updated on 02/23/15


affiliate_link

Disclosure: We are a website that needs compensation to operate like any other website on the internet.
We may receive consideration for our reviews but we are totally unbiased and do not accept paid reviews or fake reviews claiming to be something they are not.