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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T22:28:32+00:00 2026-05-20T22:28:32+00:00

I have the following HTML page: <div id=foobar> <?php echo $dynamicVar; ?> </div> <input

  • 0

I have the following HTML page:

<div id="foobar">
  <?php echo $dynamicVar; ?>
</div>
<input type="button" value="Submit" id="subButton"/>

When I press submit, the value of $dynamicVar will change. Is there a way, without using Ajax callbacks, .each(), or anything complicated, to do a dead-simple refresh of the div element? I know there’s a jQuery function, I’ve seen it before, but I can’t find it now. This function will just refresh an element. Everything I’ve found requires me to write unnecessarily complicated code to attempt to refresh a very small very simple element.

For example, if the the entire div had the value “1” inside of it, and I pressed the button, I want to refresh in order to show the value “n”.

Here’s the jQuery code:

$('#subButton').live('click',function() {
   //dead-simple element refresh, nothing fancy necessary
});

Example #2:

<div id="foobar">
   <?php echo time(); ?>
</div>
<input type="button" value="Submit" id="subButton"/>

Since time generally goes forward, the timestamp should be different from a few seconds ago when the web server gave me the timestamp. I would want to have the div element do a very simple update of itself so that I would see the new timestamp upon button click.

Any help?

  • 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-20T22:28:33+00:00Added an answer on May 20, 2026 at 10:28 pm

    Were you thinking of .load()? It’s a high-level ajax function. You’d use it something like this:

    $('#subButton').live('click',function() {
       $('#foobar').load('thispage.php #foobar > *');
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following html page: <div id=a onclick =javascript:click();>a</div> <div id=b onclick =javascript:click();>b</div>
I have the following html page: <body> <div class=hide1 style=width:1000px; height:1000px;> <table width=100% border=0
I have the following index.html page set-up: <html> <head> </head> <body> <div id=container> <div
I have the following html in page: <head> <script src=jquery-1.3.2.min.js type=text/javascript></script> <script> function hideIt()
I have the following html in a page: <div> <iframe src=http://google.co.in style=width:200px;height:200px> </iframe> <iframe
I have the following HTML on my page: <div id=mypanel> <span>SomeText</span> <span>SomeText2</span> <span>SomeText3</span> <span>SomeText4</span>
I have the following webform: <%@ Page Language=C# AutoEventWireup=true CodeBehind=Default.aspx.cs Inherits=TestWebApp.Default %> <!DOCTYPE html
I have the following HTML <select> element: <select id=leaveCode name=leaveCode> <option value=10>Annual Leave</option> <option
I have the following HTML node structure: <div id=foo> <div id=bar></div> <div id=baz> <div
I have the following html <div id=menu> <ul class=horizMenu> <li id=active><a href=# id=current>About</a></li> <li><a

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.