How to check a checkbox is checked or not using jQuery

  • How to check a checkbox is checked or not using jQuery

    <html>
    <head>
    <script type="text/javascript">
     $(document).ready(function(){$('#checkdelivery').click(function(){
    
                if($(this).prop("checked") == true)
                {
      alert("The checkbox is checked");
                 $('#addressbtn').show();
       }
                else if($(this).prop("checked") == false)            {
                 alert("The checkbox is Unchecked");
      $('#addressbtn').hide();
       }
            }); 
    </script> 
    </head> 
    <body>
    <input type="checkbox" id="checkdelivery" name = "checkdelivery" 
    value = "1"> Delivery address</input> 
    <input type="submit" id="addressbtn" name="addressbtn" value="Continue" 
    class="button"style="margin-left: 30px; width: 51% !important;display:none;"/> 
    </body> 
    </html> 
     
     

Comments

Popular posts from this blog

How do i Increase the capacity of the Eclipse Output console?

How to set max connections in mysql?

An internal error occurred during: "Building workspace". Java heap space