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 8180743
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T00:17:19+00:00 2026-06-07T00:17:19+00:00

I have a trivia page that is dynamically generated by some javascript code. It

  • 0

I have a trivia page that is dynamically generated by some javascript code. It works fine in most browsers (Chrome, Safari, Firefox, Opera, IE9) but is having an odd issue with IE8. When I’m calling $(this).val() as part of a button click event handler, I’m getting an empty string as the response, even though the button clicked has a value.

Relevant JavaScript:

$(document).ready(function() {
    $(document).on("click", ".btn", function() {
        if(panel % numPanels === 1)
            {category = $(this).val();}
        nextPanel(prop);
    });
});

Relevant HTML:

<div id="buttons">
<button type="button" class="btn" value="One">Group One</button>
<button type="button" class="btn" value="Two">Group Two</button>
<button type="button" class="btn" value="Three">Group Three</button>
</div>

Any idea what’s up?

Edit: I’m using jQuery 1.7.2, and using console.log($(this).attr("value")) and console.log($(this).prop("value")) are also returning a blank string.

  • 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-07T00:17:21+00:00Added an answer on June 7, 2026 at 12:17 am

    its a bug in <button> if you are going to use javascript then my surgestion is that you use the html -data attribute:

    <div id="buttons">
        <button type="button" class="btn" data-value="One">Group One</button>
        <button type="button" class="btn" data-value="Two">Group Two</button>
        <button type="button" class="btn" data-value="Three">Group Three</button>
    </div>
    

    and use the jquery code:

    $(document).ready(function() {
        $(document).on("click", ".btn", function() {
            if(panel % numPanels === 1) {
                category = $(this).data("value");
            }
            nextPanel(prop);
        });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

It may be trivial, but I have following code that is dynamically adding some
I have a form on a page that is for the most part straight
I have some non-trivial computational code that need to be applied on data already
In a page that has a grid/list dynamically loaded via AJAX, an efficient way
I'd like to wrap some text onto the next line that I have held
I've got an asp.net page that uses dynamically populated DropDownLists and OnSelectedIndexChanged events. A
I've got an asp.net page that uses dynamically populated DropDownLists and OnSelectedIndexChanged events. A
In summary : I have an ASP.NET web page that causes an AJAX postback
I have a page that has two parts that are slower loading. As they
I have a large set (around 100) of page elements that I would like

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.