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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T01:34:34+00:00 2026-06-16T01:34:34+00:00

I am a beginner in JavaScript and HTML. I am writing a code in

  • 0

I am a beginner in JavaScript and HTML.

I am writing a code in JavaScript that converts “Infix to Postfix”.

The user enters their “desired mathematical expression” into a form (made by html), then presses a button to evaluate the solution of the infix expression.

But the program clears the page before it writes the solution.

I do NOT want the solution to appear on a cleared page. I want it to appear on the original page, in a textbox or anything else. But I can’t get the textbox to “output” anything.

Help please?
Most grateful.

  • 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-06-16T01:34:36+00:00Added an answer on June 16, 2026 at 1:34 am

    To insert text into an existing textbox, you need to do two things.

    1. You need to get the DOM element of the textbox.
    2. You need to set the right property on the textbox to put the value into it.

    There are many ways to get the DOM element of the textbox. document.getElementById() is the simplest. You put an id=”whatever” attribute on your textbox HTML and then use document.getElementById("whatever") to get the DOM element.

    This is the simplest example:

    HTML:

    <textarea id="mytext"></textarea>​
    

    Javascript:

    var element = document.getElementById("mytext");
    element.value = "This is my text";
    

    ​
    Working demo: http://jsfiddle.net/jfriend00/b4mNP/


    Do NOT try to use document.write() after the document has finished loading. That will just clear the existing document and start writing a new one.

    You also have to make sure that you don’t have a form that is doing a form submission (as that will also clear the page) and that you’re not clicking a link that will go to an href.

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

Sidebar

Related Questions

i am writing javascript code on nodepad++,i am at beginner level and write just
I am a beginner in JavaScript. This code is supposed to evaluate a postfix
am a beginner, writing one interface to create a dynamic menu(cascading) using html, javascript
I am a beginner at Ajax, and I have this html code that is
I am a beginner in JavaScript but I wrote two functions that is meant
Question : Beginner Level Code: Pure Javascript I had created a web page in
I'm currently a beginner at JavaScript and predominantly code in Java. My Question is
I am a beginner in JavaScript/HTML. I'm learning my way around the DOM and
I'm a beginner with Javascript and can't get the code below to work. When
I am a javascript beginner . I am working on a wordsmith game that

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.