jQuery Toggle Example

<!DOCTYPE html>
<html>
<head>
    <title>Toggle Method</title>
    <script type="text/javascript" src="jquery.js"></script>
    <script type="text/javascript">
        $(document).ready(function(){
            $("#button").click(function(){
                $("#message").toggle();
            });
        });
    </script>
</head>
<body>
<form id="form">
    <input type="button" id="button" value="Toggle"><br>
    <p id="message">Hello World</p>
</form>
</body>
</html>

Comments