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

  • SEARCH
  • Home
  • 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 6932629
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T11:43:47+00:00 2026-05-27T11:43:47+00:00

When I click on the Click Here!!! I get the two alert() messages but

  • 0

When I click on the Click Here!!! I get the two alert() messages but instead of the values BBB and ZZZ that I expect, I get undefined and undefined.

Any ideas what I’m doing wrong? I’m running Firefox 8.0, works in IE 8

<HTML>
<HEAD>
</HEAD>

<BODY>

<div id="1_0">
    <div id='1_1'  style="background-color: yellow;">
        <input="hidden" id="1_a" value="AAA"/>
        <input="hidden" id="1_b" value="BBB"/>
        some text, and some more
        <div>
            <div style="background-color: silver;" onclick="alert(document.getElementById('1_b').value);alert(document.getElementById('1_z').value);">
                Click Here!!!
            </div>
        </div>
    </div>
</div>


<input="hidden" id="1_z" value="ZZZ"/>

</BODY>
</HTML>
  • 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-05-27T11:43:48+00:00Added an answer on May 27, 2026 at 11:43 am

    problem is with the input=hidden. It should be <input type="hidden">

    <HTML>
    <HEAD>
    </HEAD>
    
    <BODY>
    
    <div id="1_0">
        <div id='1_1'  style="background-color: yellow;">
            <input type="hidden" id="1_a" value="AAA"/>
            <input type="hidden" id="1_b" value="BBB"/>
            some text, and some more
            <div>
                <div style="background-color: silver;" onclick="alert(document.getElementById('1_b').value);alert(document.getElementById('1_z').value);">
                    Click Here!!!
                </div>
            </div>
        </div>
    </div>
    
    
    <input type="hidden" id="1_z" value="ZZZ"/>
    
    </BODY>
    </HTML>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Click here to see what I mean.. What could prevent these two from sitting
Here is the code: $('#sousmenu a').click (function (){ startSlideshow(<?php echo json_encode(glob(photos- .$_GET[folder]. /*.jpg));?>); return
a simple question here Is there a way to change the text click here
I found this on Google, click here , which someone asked a similar question,
Using preview 4 of ASP.NET MVC Code like: <%= Html.CheckBox( myCheckBox, Click Here, True,
$('<div class=error></div>').html('<h2>(click here to dismiss)</h2>').insertAfter($('#someid')).fadeIn('slow').animate({ opacity: 1.0 }, 1000).click(function() { $(this).fadeOut('slow', function() { $(this).remove()
$('#selector').click(function() { // here I would like to load a javascript file // let's
Here is the code for the button click event; Protected Sub CompetenciesButton_Click(ByVal sender As
Here are two functions. function getUserInformation(UserID) { $.post(assets/scripts/chat/get_user_info.php, { UserID: UserID }, function (data)
JSfiddle (showing the non-working code) here: http://jsfiddle.net/ts2Rr/ I have three boxes that a user

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.