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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T06:02:31+00:00 2026-06-16T06:02:31+00:00

<tr> <td>page header</td> <td> <input type=text id=pageh /></td> </tr> <tr> <td>Header color:</td> <td> <select

  • 0
<tr>
<td>page header</td>
<td>
    <input type="text" id="pageh" /></td>
</tr>
<tr>
<td>Header color:</td>
<td>
    <select id="hcolor">
        <option>Red</option>
        <option>Purple</option>
        <option>Gray</option>
    </select></td>
 </tr>
 <tr>
<td>Header size</td>
<td>
    <select id="hsize">
        <option>12px</option>
        <option>18px</option>
        <option>24px</option>
    </select></td>
</tr>
<tr>
<td></td>
<td><input type="button" value="Send" onclick="Start()" /><input type="reset" value="Clear" /></td>
</tr>

So, I want to take the textbox text, copy it into a var like this var text = document.GetElementByID("pageh").value; and then execute it to a document.write with the selected colors and sizes from the lists.

  • 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-16T06:02:32+00:00Added an answer on June 16, 2026 at 6:02 am

    Something like this?

    function Start() { 
        var text = document.getElementById('pageh').value; // get the value of the textbox
        var color_el = document.getElementById('hcolor');
        var color = color_el.options[color_el.selectedIndex].innerText.toLowerCase(); // get the selected color
        var size_el = document.getElementById('hsize');
        var size = size_el.options[size_el.selectedIndex].innerText; // get the font-size
        // make a p element with the selected style properties
        document.write("<p style='color: "+ color +"; font-size: " + size + "'>" + text + "</p>"); 
    }
    

    the size_el.options and color_el.options are element lists of the options in the select tags,
    The size_el.selectedIndex and size_el.selectedIndex are the selected options, represented by integers. so color_el.options[2] would give us the third option element. Then we “extract” the innerText from the elements.

    Last we create an paragraph element, which looks something like <p style="color: gray; font-size: 24px">test</p> the color should preferable be written with lowecase letter, therefore we transform the “Gray” to “gray” by using “Gray”.toLowerCase()

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

Sidebar

Related Questions

work on asp.net vs 05 C#.Master page header contain the bellow code <script type=text/javascript
I have this test page http://thechozenfew.net/projects/write_font.php that generates the text in the input box
In my web page header, there are several buttons. What I want is to
In my Page_Load I identify the page header block from my master page and
I've got this code on my page: header(Location: $page); $page is passed to the
I am building a 3 column web page (header & menu bar above a
I want to link a template php page (header.php) to a custom php page
Imagine I have a navigation bar in my page header, with a number of
I have a page with header,content and footer. Issue i'm facing with the page
I have a master page with Header, Menu, Content and Footer panes in my

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.