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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T14:55:00+00:00 2026-05-25T14:55:00+00:00

I am trying to create a bit of jquery code to update an element

  • 0

I am trying to create a bit of jquery code to update an element but im having a problem. It wont update and I think its because of the element id?

Here is my JS Code:

<script type="text/javascript">
    $(document).ready(function()
    {
        $("#vote_button_" + $(this).attr('id')).click(function()
        { 
            $("div#vote_count").show().html('<h2>voting, please wait...</h2>');
        });
    });
</script>

And this is the HTML Code:

<div class="vote_container"> 
    <div class="vote_button" id="vote_button_31"><img src="/images/picture_31.png"></div> 
    <div class="vote_count" id="vote_count">0</div> 
</div> 
  • 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-25T14:55:00+00:00Added an answer on May 25, 2026 at 2:55 pm

    You’re telling it to use the ID of the document (I think).

    You can surely just do:

        $("#vote_button_31").click(function()
        { 
            $("#vote_count").show().html('<h2>voting, please wait...</h2>');
        });
    

    If you want the code to work on all vote buttons try this:

        $(".vote_button").click(function()
        { 
            $(this).siblings('.vote_count').show().html('<h2>voting, please wait...</h2>');
        });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to create a 4-bit PNG file in C# but my code
Bit of a newb but just having a small problem using jquery cycle all
I'm trying to wrap div with specific html code but I'm having problem using
I'm having a bit of a trouble trying to create a multi window'ed console
I'm trying to create a database but in the design process. A bit of
I'm trying to create some drop down elements with CSS and jquery. Here's what
I'm a bit confused it seems here. What I'm trying to do is create
I'm trying to create some HtmlHelper extensions and ran into a bit of a
Ok so I am trying create a login script, here I am using PHP5
Trying to create a user account in a test. But getting a Object reference

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.