Truemag

  • Categories
    • Tips And Tricks
    • Internet
    • PHP
    • Javascript
    • CSharp
    • SQL Server
    • Linux
  • Lastest Videos
  • Our Demos
  • About
  • Contact
  • Home
  • Write With Us
  • Job Request
Home Javascript Jquery checkbox checked

Jquery checkbox checked

If you are asking how to detect if a HTML checkbox is checked or not by using Jquery Javascript, you can do this with a simple example below:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script type='text/javascript' src='http://rapid-dev.net/wp-includes/js/jquery/jquery.js?ver=1.2.6'></script>
</head>
<script type="text/javascript">
    jQuery(document).ready(function()
    {
        jQuery("#chkNewProposal").click(function(){
            if(jQuery('#chkNewProposal').is(':checked'))
            {
                alert("a: " + jQuery('#chkNewProposal').val());
            }
 
            if(jQuery('#chkNewProposal').attr('checked'))
            {
                alert("b: " + jQuery('#chkNewProposal').val());
            }
        });
    });
</script>
 
<body>
<input type="checkbox" name="chkNewProposal" id="chkNewProposal" />
</body>
</html>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <script type='text/javascript' src='http://rapid-dev.net/wp-includes/js/jquery/jquery.js?ver=1.2.6'></script> </head> <script type="text/javascript"> jQuery(document).ready(function() { jQuery("#chkNewProposal").click(function(){ if(jQuery('#chkNewProposal').is(':checked')) { alert("a: " + jQuery('#chkNewProposal').val()); } if(jQuery('#chkNewProposal').attr('checked')) { alert("b: " + jQuery('#chkNewProposal').val()); } }); }); </script> <body> <input type="checkbox" name="chkNewProposal" id="chkNewProposal" /> </body> </html>

Mar 4, 2011Hoan Huynh
Fatal error: Uncaught CurlException: 60: SSL certificate problem, verify that the CA cert is OK. Details: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed thrownGoogle Ad Planner API
You Might Also Like:
  • Get Image Width Height With JQuery And JavaScript
  • JQuery Get selected value of radio button
  • How To Track Website With Multiple Google Analytisc Accounts
  • Auto Load YouTube Video As A Popup With JQuery FancyBox
  • Facebook Like Button And Recommend Button With fb:like, iframe and html5
  • JQuery How to use DatePicker
  • JQuery Create Textbox With Count Down Limit Characters
  • Validate Date With JQuery And Date Object
  • ASP.NET JQuery Autocomplete Textbox
  • JQuery Allow only numeric characters or only alphabet characters in textbox
Hoan Huynh

Hoan Huynh is the founder and head of 4rapiddev.com. Reach him at [email protected]

10 years ago JavascriptJQuery130
0
GooglePlus
0
Facebook
0
Twitter
0
Digg
0
Delicious
0
Stumbleupon
0
Linkedin
0
Pinterest
Most Viewed
PHP Download Image Or File From URL
22,237 views
Notepad Plus Plus Compare Plugin
How To Install Compare Text Plugin In Notepad Plus Plus
20,087 views
Microsoft SQL Server 2008 Attach Remove Log
Delete, Shrink, Eliminate Transaction Log .LDF File
15,872 views
JQuery Allow only numeric characters or only alphabet characters in textbox
13,343 views
C# Read Json From URL And Parse/Deserialize Json
9,850 views
4 Rapid Development is a central page that is targeted at newbie and professional programmers, database administrators, system admin, web masters and bloggers.
Recent Posts
  • Term Papers – Easy to Take Care of
  • How to Write Term Papers in Online Tutorials
  • How to Plan Writing an Essay
  • How to Apply For a Payday Loan With Bad Credit
  • Statistics For Sale – How To Compose One
Categories
  • CSharp (45)
  • Facebook Graph API (19)
  • Google API (7)
  • Internet (87)
  • iPhone XCode (8)
  • Javascript (35)
  • Linux (28)
  • MySQL (16)
  • PHP (84)
  • Problem Issue Error (29)
  • Resources (32)
  • SQL Server (25)
  • Timeline (5)
  • Tips And Tricks (141)
  • Uncategorized (123)
Recommended
  • Custom Software Development Company
  • Online Useful Tools
  • Premium Themes
  • VPS
2014 © 4 Rapid Development