How to create jQuery function that run on click on paragraph ( <p> ) tag

1 Answer

0 votes
<!DOCTYPE html>
<html>
    <head>
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
        <script>
            $(document).ready(function() 
            {
                $("p").click
                (
                    function()
                    {
                        alert("ok");
                    }
                );
            });
        </script>
    </head>
    <body>
         <p>click on me</p>   
    </body>
</html>

 



answered Nov 24, 2015 by avibootz
...