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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T06:15:34+00:00 2026-05-15T06:15:34+00:00

I have a header message that is brought in from another file (message.txt), and

  • 0

I have a header message that is brought in from another file (message.txt), and I’m making a text box that you can edit. (I will add the part where it makes it permanent later on.)
It is changing to nothing.

(E: “This is the header!” to “”)

This is the code..

<script type="text/javascript">
function change(text)
{
//document.forms["f1"].elements["ta"].value="Hi!";
//document.f1.ta.value="Hi!";
document.getElementById("msg").innerHTML='<h2 class="hmsg">'+text+'</h2>';
}
function getText()
{
return document.getElementById("ta").value;
}
function all()
{
change(getText())
}
</script>
<form name="f1">
<input type="text" value="Enter your message here!" id="ta"/>
<input type="button" value="          " onclick='all()'/>
</form>
  • 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-15T06:15:35+00:00Added an answer on May 15, 2026 at 6:15 am

    Perhaps you can clarify what is not working as you expect. I expanded your code into a working example:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
     "DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Script-Type" content="text/javascript" />
    <title>Test</title>
    </head>
    <body>
    <script type="text/javascript">
    function change(text)
    {
      document.getElementById("msg").innerHTML='<h2 class="hmsg">'+text+'</h2>';
    }
    function getText()
    {
    return document.getElementById("ta").value;
    }
    function all()
    {
      change(getText())
    }
    </script>
    <form action="#">
    <div id="msg">
    </div>
    <div>
    <input type="text" value="Enter your message here!" id="ta"/>
    <input type="button" value="          " onclick='all()'/>
    </div>
    </form>
    </body>
    </html>
    

    Changing the content of the <div> with id msg works here.

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

Sidebar

Related Questions

I have another script that I can't figure out what is wrong with it.
I have a program that will get messages from a server and store them
Lets say that I have a header user control in a master page, and
I have a c++ header file containing a class. I want to use this
I have systematically an error when I'm trying to upload a file that is
I have the following SOAP message that i want to post it to my
I have created one library with Utility.h file. I want to add that custom
I'm having difficulties closing an email message that I have raised. The email opens
I have a BizTalk schema that looks something like this: <Root> <Header> <SomeData></SomeData> <Detail>
Why does C++ have header files and .cpp files?

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.