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

The Archive Base Latest Questions

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

This is my second day of doing anything at all with javascript so I

  • 0

This is my second day of doing anything at all with javascript so I am a complete beginner. As the title states, I just want to change the text value of a textbox using the settimeout function. I have searched the internet and have come to a dead end. This is what I have so far,

    putftp.onclick = function () {
    var Text = document.getElementById("TextBox");


    function firsttext() {
       document.getElementbyID("TextBox").innerHTML = "This is the first test.";
       setTimeout("secondtest()",3000);
    }
    function secondtest() {
        document.getElementById("TextBox").innerHTML = "This is the second test.";
        setTimeout("thirdtest()",5000);
    }
   function thirdtest() {
        document.getElementById("TextBox").innerHTML = "This is the last test.";
    }
};

Im not sure if Im using the correct format, or if Im even anywhere close to being correct. Im pretty sure everything is ok except for the document.getElementbyID(“textbox”).innerHTML part. I would think something there would be changed, but its only my second day so I really could be clueless about this whole issue. Thanks for your help in advance!

  • 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-26T15:20:39+00:00Added an answer on May 26, 2026 at 3:20 pm

    To change the text once 3 seconds after the button click, have this:

    putftp.onclick = function () {
        window.setTimeout(function() {
           document.getElementById("TextBox").value = "This is the first test.";
        }, 3000);
    };
    

    You have two errors in your orignal code which I fixed for you:

    1. Assuming TextBox is a text box, you need to assign its value property, not innerHTML.
    2. The correct name is getElementById and not getElementbyID. JavaScript is case sensitive.

    To change it again two seconds later, you can add “nested” timer:

    putftp.onclick = function () {
        window.setTimeout(function() {
           document.getElementById("TextBox").value = "This is the first test.";
           window.setTimeout(function() {
               document.getElementById("TextBox").value= "This is the second test.";
            }, 2000);
        }, 3000);
    };
    

    Live test case.

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

Sidebar

Related Questions

In this particular code sample I want to reference the second overloaded method (int
I'm struggling with this problem for a day now, and I just can't figure
I've spent a day on this so far and just can't figure it out.
I've got a Perl script that needs to execute another Perl script. This second
I've a application that must work after another application. This second application has a
Ok, I need something like this: datediff(second, date_one, date_two) < 1 dates are stored
This is a second-hand question from an OS development site, but it made me
This is my second question on Bamboo ( My First One ). My understanding
I hope it's the heat, this is the second question today and it's one
This most be the second most simple rollover effect, still I don't find any

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.