answersLogoWhite

0


Best Answer

Firstly, you have to have an ID assigned to the input field:

<input type="text" id="ourText">

Then you use the getElementById. The property of the input field that contains the text entered is called "value." In this case, I'm going to store it in a variable I've named "userEntered." Then I'll use it in an alert.

var userEntered = document.getElementById("ourText").value;

alert(userEntered);

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you get contests of an input box using javascript?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How do you show the text box output in the browser using Ajax code?

You can directly do that in the JavaScript. Just get the value of the input type in JavaScript using id and show it using .innerHTML.


How do you open the dialog box?

code for opening the font dialog box using javascript


How do I put a dropdown list inside a prompt box using Javascript?

not posiible


How do you enable the text-box in html?

You can enable the text box in HTML using input tag. The input tag asks the input type and make it to Text.


What control and method provides a simple way to gather input from the user at runtime without placing a text box on a form?

You could use the prompt command in Javascript.


How do you get the popup javascript box?

Use confirm or alert in javascript code to get a popup


How do you enable javascript in your web browser using IE and Mozilla Firefox?

There isn't a way to enable or disable JavaScript in IE8 or IE7. In Firefox, you go to Tools &gt; Options &gt; Content &gt; and check the box that says Enable JavaScript then click OK. Other IE's might have javascript, I don't know how to enable javascript for IE, this might be hard to know...


What is the term for a mouse scrolling onto an image and a caption box appearing over the picture and where can you find out how to do that?

You can do it using the onMouseOver event in javascript


How do you get your home theatre system to play everything you watch on tv?

Using a Cable or Satellite tuner box, connect the audio output of the box to the input on the home theater system. If you are not using an external box, connect the audio output of the TV to the input on the home theatre system.


How do you get a working comment box on your website?

To get a working comment/feedback box, you will need to use the programming languages HTML and Javascript (javascript is widely used for forms)


How can one learn how to program the JavaScript confirm dialog box into their code?

There are a number of ways in which one can learn how to program the JavaScript confirm dialog box into their code. One way is by reading the relevant tutorials on the website JavaScript Kit.


How do you ADD search option in a webpage?

Search option can be placed using an input box. You can set the data filtering using jQuery.