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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T18:43:44+00:00 2026-05-27T18:43:44+00:00

I am making a page where users can answer questions (using radio buttons) about

  • 0

I am making a page where users can answer questions (using radio buttons) about a product they are selling back. When they hit a button at the bottom of the page, a price quote will pop up. I have written a javascript function to be performed when the user hits the button. It calculates the price and displays it using document.write, but whenever the user hits the button, it opens up a new page and displays what I told it to.

function getQuote(){
    document.write("Your Quote Is: $", price, ".00");
}

And here is the code for the button:

<button type="button" onclick='getQuote()'>Display Quote</button>

But when I push the button, a new page shows up and it shows the quote with only the formatting I put into the document.write phrase.

I have tried using .innerHTML to send the document.write to another part of the page, but the same problem persists.

What can I do to make sure that the quote shows up on the page, where I want it to?

  • 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-27T18:43:45+00:00Added an answer on May 27, 2026 at 6:43 pm

    There is no issue with document.write, it is doing exactly what it is supposed to do:

    Overwrite the page with the new content.

    If you do not want to do that, then you have to give it some context to write to.

    For example:

    function getQuote(){
        var textArea = document.getElementById('textArea');
        textArea.innerHTML = "Your Quote Is: $", price, ".00";
    }
    

    Which puts whatever your text is into a DOM element with id="textArea"

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

Sidebar

Related Questions

I'm making a website with a page where users can sign up to win
I'm making an aspx page that can edit books. A book is an complex
I'm making an app where users can write reviews on venues and currently have
Im making my little site where users can create blogs, and have studied publishing
So my site's main page display's applications for a PMP. Users can rate these
I'm making a page where the user upload a file. I want an if
I am currently building an making my new website. It uses one page and
I'm making a page which has some interaction provided by javascript. Just as an
Please have a look at this page www.pixeli.ca/issue. I have begun making a page
OK, say that my application is emitting (x86) instructions into memory, making the page

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.