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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T23:11:39+00:00 2026-05-25T23:11:39+00:00

I have an issue. I use this code: var test=’test’; $(‘#tip’).delay(1000).html(test); That doesn’t work,

  • 0

I have an issue.
I use this code:

var test='test';
$('#tip').delay(1000).html(test);

That doesn’t work, it won’t change the text. Although, it works if I do html(‘test’) instead of having a variable there. I’ve also tried using non jQuery JavaScript:

var test='test';
setTimeout("document.getElementById('tip').innerHTML=text", 1000);

As earlier, it only works if I directly input the text instead of a variable.

But how can I fix so it setTimeout works with variables too? Or is there any ind of work-around?

Btw, I use jQuery 1.6.3.

EDIT: Sorry, only the standard method (non jQuery) works as supposed when trying to do that without variable. With jQuery it makes it ‘test’ first, and the delay comes after.

  • 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-25T23:11:40+00:00Added an answer on May 25, 2026 at 11:11 pm

    I’ve just written a function:

    (function(text){
        setTimeout(function(){
            document.getElementById("tip").innerHTML = text;
        }, 1000);
    })(text)
    

    The timeout is wrapped inside an anonymous function, so that multiple test variables can be used, and don’t interfere with each other. Instead of wrapping the text in an anonymous function , you can also name the function, and call it from within a script: funcName("test text").

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

Sidebar

Related Questions

I have issue that is reproduced on g++. VC++ doesn't meet any problems. So
I have an issue with this jquery code below. Please give me advice or
I have this bit of code that is being converted from vb6 to vb.net.
I have embedded the fullcalendar jquery control by using this code: $(document).ready(function() { var
I have $('#structure').html(html); This works fine in FireFox. IE 8 doesn't display the html.
...so I have this code: foreach (var entry in list) { var marginOneEntry =
i have an issue i could use some help with, i have python list
I have a weird issue with printing data out. I use printf to print
We're having a small issue and could use some help - we have the
hello i have a silly issue, my link isn't shown. i use the same

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.