Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8339849
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T04:59:43+00:00 2026-06-09T04:59:43+00:00

html <span class=checkbox GroupName=ckmill> <input id=ctl01 type=checkbox name=ctl01 /> <label for=ctl01>A</label></span> js $(document).ready(function() {

  • 0

html

<span class="checkbox" GroupName="ckmill">
<input id="ctl01" type="checkbox" name="ctl01" />
<label for="ctl01">A</label></span>

js

 $(document).ready(function() {
        $('.checkbox').click(function(){
            var  $text2=$(this);

            alert($text2.attr("text"));
        });
    });​

while executing it shows.. UNDEFINED

What is the solution?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T04:59:47+00:00Added an answer on June 9, 2026 at 4:59 am

    Dmeo: http://jsfiddle.net/LuRqK/

    2 things:

    1) to get the attribute of the inner input use children http://api.jquery.com/children/

    2) to get the text or html use .text or .html api

    codE

     $(document).ready(function() {
            $('.checkbox').click(function(){
                var  $text2=$(this);
                 alert($text2.text());
                alert($text2.children('#ctl01').attr('name'));
            });
        });​
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Consider the following code: $(document).ready(function() { $(body).append(<div class='outer'><span class='inner'>Click me</span></div>); $(html).click(function(event) { var targetClass
The following code ((CheckBox)e.Row.FindControl(exportCb)).CssClass = enabledExport; Creates html <span class=enabledExport><input id=_ctl0_ContentPlaceHolder1_gridviewName__ctl2_exportCb type=checkbox name=_ctl0:ContentPlaceHolder1:gridviewName:_ctl2:exportCb /></span>
I have a HTML snippet like the following <tr class=new> <td> <input name=id type=checkbox/>
Hello friends following is my code HTML <ul> <li> <div class=input><input name= type=checkbox value=
I have some html form <div id=1> <div> <span class=checkbox style=background-position: 0pt -34px;></span> <input
This is the checkbox <input id=c1 type=checkbox name=hour[] class=create-daily value=1 /><br /> <input id=c2
Here is my HTML code: <div id=playlist_item> <ul class=link id=link> <div class=style><input type=checkbox class=styled>
Here is my code: $('.adsize_click').click(function () { $(this).closest('span').toggleClass('ad_active'); $('.ads_selected').append($(this).closest('label').html()); }); I have a bunch
I want to generate html like, <label for='field'> Label Text <span class='span1'> Some Text
The following gives me the error Uncaught SyntaxError: Unexpected identifier : $('span.xtro').html(''); $('span.xtro').html('<input type='button'

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.