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 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 a header file, lets say Common.h, that is included in all of
I have another script that I can't figure out what is wrong with it.
I have a header file that has some static variables for all of my
I have a header file that looks like this: #pragma once //C++ Output Streams
I am developing a software package that transmits messages. Currently I have a header
I have a header file buildTree.h and a C file buildTree.c there is a
I have a header text in a h1 tag. I'd like to have a
I have a header file like this: #ifndef __GEN_NOTE_MARKERS_TO_DEVELOPERS_HPP__ #define __GEN_NOTE_MARKERS_TO_DEVELOPERS_HPP__ #ifdef _DEBUG //
So I have a header file and 2 .c files within the beginnings of
I need to extract XMLs from a huge (around 500mb) file but I have

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.