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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T08:49:02+00:00 2026-06-06T08:49:02+00:00

I am having problems updating a SPAN in my HTML with the result from

  • 0

I am having problems updating a SPAN in my HTML with the result from a PHP file. In the HTML below the is a link that calls the php file that will update the SPAN above it with the new value.

HTML

        <div class="link-votes">
            <span id="v<?php echo $link_id; ?>"><?php echo $votes; ?></span>
        </div>
        <a href="#" class="vote" id="<?php echo $link_id; ?>" name="up" title="Up vote"></a>

PHP

if($_POST['id']) {
    $up_value=$row['vote_count'];
    $("#v"+id).html(html) = $up_value;
}

If I echo $up_value the right integer is printed. But I cannot update the value in the SPAN.\

Thanks,

  • 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-06T08:49:04+00:00Added an answer on June 6, 2026 at 8:49 am

    You are mixing Javascript code with PHP code. You are using the html() function which looks like it might be from the JQuery library. You might want to echo() in PHP and then use Javascript to work on the return value of that echo() statement. It should work as the echo() will be done before the Javascript takes effect, as is the required flow of execution.

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

Sidebar

Related Questions

I'm having problems updating a div's content in IE using .update; I also tried
I am having problems writing statements, especially when updating. I want to update a
Im trying to update details of a single customer and I'm having problems updating
We're having mysterious network problems with MySQL. Simple update query (updating single row using
I'm having problems updating records to contain NULL values - in particular, a field
im having problems starting a codeigniter project, the problem is that when i do
I have started having problems with my VPS in the way that it would
I am having some problems updating to the right value. On the page which
I'm having problems passing information, updating progress and indicating done with a SwingWorker class
I'm currently having problems having the UI refresh when I'm getting new data from

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.