Solved

Get checkbox value

Posted on 2014-11-10
1
110 Views
Last Modified: 2014-11-10
How can I return the checkbox value when the checkbox is clicked.
What is wrong with this


    <script type="text/javascript">
     
        function OptionsSelected(e) {
            alert((e.target || e.srcElement).value);
        }
    </script>

<body>
    <input type="checkbox" name="checkgrp" onclick="return OptionsSelected(e)" value="Test_Value" id="Test">Test
 
</body>
0
Comment
Question by:JElster
1 Comment
 
LVL 82

Accepted Solution

by:
leakim971 earned 500 total points
ID: 40432941
Test page : http://jsfiddle.net/vxkjpkoo/

   <script type="text/javascript">
      
        function OptionsSelected(me) {
            alert(me.value);
        }
    </script>

<body>
    <input type="checkbox" name="checkgrp" onclick="return OptionsSelected(this)" value="Test_Value" id="Test">Test
  
</body>

Open in new window

0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Today I would like to talk about localizing (Internationalization) JavaScript applications. Introduction When creating an application that is going to be used by many people around the globe, it is important to remember that not everyone speak…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question