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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T15:19:26+00:00 2026-05-17T15:19:26+00:00

i have this jquery problems i have had for days, im so new to

  • 0

i have this jquery problems i have had for days, im so new to this, so excuse my dumbness in this subject. thanks :))

html code:

<ul class="statuses">
<li id="set_23" class="message">
  // this is meant to increase everytime you click the vote_up just like stackoverflow 
  <span class="vote_count">27</span>
  <a href="#" class="vote_up"><img src="img/uparrow.png" /></a>
  <a href="#" class="vote_down"><img src="img/downarrow.png" /></a>

 </li>

</ul>

this is my jquery code:

$(document).ready(function() {
    $('#statuses').delegate('.vote_up', 'click', function() {
       //get the id
        var the_id = $(this).closest('.message').attr('id').split('_').pop();
        //the main ajax request
        $.ajax({
            type: "POST",
            data: "action=vote_up&id=" + the_id,
            url: "ajax/votes.php",
            success: function (msg) {
                  // fade in the new vote_count
                $(this).siblings("span.vote_count").html(msg).fadeIn();
                  // get the child <img> and set its src
                $(this).children("img").attr("src", "img/uparrowActive.png");
            }
        });
    });

});

EDIT: also the jquery fade.in and change of image src is not working, am i referencing the right span or class(the ajax request is working now)

  • 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-17T15:19:27+00:00Added an answer on May 17, 2026 at 3:19 pm

    First thing to jump-out:

    <ul class="statuses"> 
    

    and

    $('#statuses')
    

    … the # symbol in jQuery is the id-selector (same as CSS). Since your <ul> is set to class="statuses" then you’ll need to use the class-selector:

    $('.statuses')
    

    That alone will break all your jQuery

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some problems with this code? Here is my code that creates text
I'm working on a program that uses HTML/CSS/Javascript/JQuery for its user interface. One of
I'm facing one of the craziest problems I've ever found in css... I have
I'm having some problems with a weird HTTP status code in MSIE8. I send
Recently, my friend helped me fix a background overlay problem. I had an issue
I have a fairly simple web app built with Delphi (2009) Web Broker. I
I have an error trying to use $(document).ready() as in the above image. What
I've got two input boxes in a div, I want to hide that div
Short version of Problem Autocomplete works when the input string matches the result string,
let me start by saying it may look simple but im finding it extremely

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.