input (JavaScript 1.0)

Input element on an HTML form.

Properties & Events

KeyDescriptionAvailability
checkedIf the element is a radio button or checkbox, specifies whether or not the element is checked.
chrome 1.0safari 1.0Firefox 1.0ie 3.0opera 7.0
defaultcheckedIf the element is a radio button or checkbox, specifies whether or not the element is checked by default.
chrome 1.0safari 1.0Firefox 1.0ie 3.0opera 7.0
defaultvalueSpecifies the default value for the element text.
chrome 1.0safari 1.0Firefox 1.0ie 3.0opera 7.0
formReference to the form that contains the element.
chrome 1.0safari 1.0Firefox 1.0ie 3.0opera 7.0
lengthNumber of options in the options array for the element.
chrome 1.0safari 1.0Firefox 1.0ie 3.0opera 7.0
nameName of the element.
chrome 1.0safari 1.0Firefox 1.0ie 3.0opera 7.0
optionsIf the element is a Select list, specifies the list of options (as an array) for the element.
chrome 1.0safari 1.0Firefox 1.0ie 3.0opera 7.0
selectedindexIf the element is a Select list, specifies the index of the selected option in the options array.
chrome 1.0safari 1.0Firefox 1.0ie 3.0opera 7.0
typeType of form element the input element is.
chrome 1.0safari 1.0Firefox 1.0ie 3.0opera 7.0
valueValue of the element when the form is submitted.
chrome 1.0safari 1.0Firefox 1.0ie 3.0opera 7.0
onblurEvent handler for when focus is moved off the element.
chrome 1.0safari 1.0Firefox 1.0ie 3.0opera 7.0
onchangeEvent handler for when a user changes makes a change element and moves focus off the element.
chrome 1.0safari 1.0Firefox 1.0ie 3.0opera 7.0
onclickEvent handler for when a user clicks on the element.
chrome 1.0safari 1.0Firefox 1.0ie 3.0opera 7.0
onfocusEvent handler for when a user gives focus to the element.
chrome 1.0safari 1.0Firefox 1.0ie 3.0opera 7.0

Result from the Online TryIt-Editor
chrome 1.0safari 1.0Firefox 1.0ie 3.0opera 4.0

Examples having uses of: 'input'

16 votes
14k views

HTML5 details

The details element represents a disclosure widget from which the user can obtain additional information or controls. However, the details element is not appropriate for footnotes.
2 votes
9k views

JavaScript Prompt Object

Prompt box used for taking input from user. If you click on ok button then it return input value else it return null
0 votes
8k views

URL Encoding

In JavaScript there are functions that can be used to URL encode a string. In JavaScript you can use the encodeURI function
4 votes
8k views

HTML5 Datalist

Think of a combination of an input text element and selection list. Typically used where there is the likelihood of a visitor entering a value of other (not one of the items in the list).
0 votes
8k views

JavaScript setTimeout and clearTimeout

JavaScript clearTimeout function enables you to stop the timer event started by the JavaScript setTimeout function. When you apply the setTimeout function using a recursive loop over the JavaScript function by specifying the time delay then it calls the function continuously after equal intervals of time.
9 votes
8k views

JavaScript Introduction

JavaScript is a client side scripting language that can make your webpage intaractive and JavaScript can be embbeded into your static HTML webpage directly.
2 votes
7k views

Html Textbox

The contents are interpreted as text only; HTML markup is ignored. The user can type (theoretically) unlimited amounts of text into the textarea field. In reality the browser sets the limit.
1 votes
7k views

jQuery AJAX Life Cycle

jQuery AJAX life cycle demonstration. This is a demonstration of the methods ajaxStart, ajaxSend, ajaxComplete, ajaxStop, and ajaxSuccess that are triggered when load method is called.
1 votes
6k views

jQuery Plugin Introduction

By extending jQuery, you create reusable components that can be used on any web page. Your code is encapsulated and there is less risk that you will use the same function names elsewhere.
0 votes
6k views

JavaScript Click and Mouse Events

Javascript Events are the actions which are detected by the javascript when they are fired.
2 votes
6k views

jQuery - Get CSS information

Using the css property we can get the simple CSS property value of an attribute.
1 votes
6k views

JavaScript setTimeout function

JavaScript setTimeout function provides the functionality to execute the specified function after the sepcified number of milliseconds. Using the JavaScript setTimeout function you can set the delay before function execution.
0 votes
5k views

JavaScript switch statement with number

The switch statement is used to select one statement from the many blocks. This is used on place of nested if…else. If there are number of if..else statements then we should use switch.
2 votes
5k views

JavaScript Required Validation

JavaScript validation are client side scrips that is used to reduce the server load because all validation are check on client browser. This example has a required validation on the input box.
0 votes
5k views

JavaScript function Introduction

A function in Javascript is a group of statement that is executed when it's triggered. A function can be called from anywhere within the page. As it is the part of javascript it is defined under the <script> tag.
3 votes
4k views

JavaScript if and else

JavaScript if…else is a conditional statement that is used to check wether a condition is true or false to take a decision.
1 votes
4k views

JavaScript For

Javascripts loops are similar to other programming languages. Loops allows us to execute a block of statements to the specified number of times.
0 votes
2k views

HTML5 summary

The summary element represents a summary, caption, or legend for the rest of the contents of the summary element's parent details element, if any.
0 votes
1k views

HTML5 Keygen

The HTML <keygen> tag is used for generating a key pair. When the control's form is submitted, the private key is stored in the local keystore, and the public key is packaged and sent to the server.
0 votes
1k views

JavaScript onselect Event

Triggers whenever you Select/Highlight some text within textbox or textarea.
1 votes
1k views

jQuery Focus & Change Event

jQuery events can be used to register behaviors to take effect when the user interacts with the browser, and to further manipulate those registered behaviors.
2 votes
1k views

HTML Input

This HTML element specifies an input control for a form. The type of input is set by the type attribute and can be a variety of different types. (See Advanced HTML for more information about the different input types)
1 votes
1k views

JavaScript Numeric Validation

JavaScript validation are client side scrips that is used to reduce the server load because all validation are check on client browser. This example validates numeric characters on the input.
0 votes
1k views

JavaScript clearInterval method

JavaScript clearInterval function enables you to stop the timer event started by the JavaScript setIntterval function. When you apply the setInterval function a JavaScript function by specifying the time interval then it calls the function continuously after equal intervals of time.
1 votes
1k views

Html Input Form

Example form using <legend> and <fieldset> to make the form layout fancy.
0 votes
1k views

JavaScript Keyboard Events

This event are fired when a key is pressed. IE 8 and earlier use event.keyCode to retrieve the key that was pressed down, while Firefox/Chrome/Safari/Opera use event.which.
0 votes
1k views

HTML Radio buttons and Checkboxes

Form containing two radio buttons and two checkboxes. Note: The name attribute is used to group the radio buttons and checkboxes into groups.
0 votes
1k views

JavaScript setTimeout method

Here in a text box the timer is display on "start count" button click and stop on "start count " click
1 votes
1k views

Javascript Email Address Validation

JavaScript validation are client side scrips that is used to reduce the server load because all validation are check on client browser. This example validates the input matches a valid e-mail address with a regular expression.
0 votes
1k views

HTML5 Output

Perform a calculation and show the result in an <output> element
0 votes
1k views

JavaScript Alphabetic Character Validation

JavaScript validation are client side scrips that is used to reduce the server load because all validation are check on client browser. This example validates alphabetic characters on the input
0 votes
1k views

jQuery Fade

The jQuery fade methods gradually change the opacity for selected elements.
1 votes
1k views

jQuery User Controlled Animation

jQuery Animate can function supports animation in different directions
0 votes
1k views

JavaScript Try and Catch inside a function

Javascript Try…catch statement to check if there is errors in a block of code.
0 votes
1k views

JavaScript window Object

Create a new window and move new browser window.
0 votes
1k views

JavaScript switch statement with string

The switch statement is used to select one statement from the many blocks. This is used on place of nested if…else. If there are number of if..else statements then we should use switch.
0 votes
1k views

HTML Password

Password Field <input type="password" /> defines a password field:
0 votes
1k views

CSS enabled & disabled

These are used to apply the properties on the elements that are either enable or disable.
0 votes
1k views

JavaScript onfocus Event

JavaScript event that triggers when object gets focus.
0 votes
1k views

JavaScript function with arguments

A function can take arguments whenever it is called. When arguments are passed on calling of function, the fuction is called 'function with arguments'. When a funtion does not take any argument function is called 'function without argument'. A function can return a value using the keyword 'return'.
1 votes
1k views

jQuery Element manipulation

jQuery contains powerful methods (functions) for changing and manipulating HTML elements and attributes. Click on the button to see jQuery hiding the paragraphs.
0 votes
1k views

jQuery - Set CSS for an element

jQuery also allows us the set the property value of the CSS.
0 votes
1k views

jQuery - Multiple CSS properties

jQuery allows to change the multiple CSS properties value at once.
0 votes
1k views

JavaScript Print method

Opens a dialog window for printing the current web page.
0 votes
1k views

JavaScript nested if and else

This statement allows us to select one statement among many statements.It is also called nested if….else.
0 votes
1k views

JavaScript iframe height

The Frame and Iframe represents html frame and iframe respectively.This DOM object has all the properties that a HTML element has. We can change these properties using javascript.
0 votes
1k views

JavaScript Loop with break and continue

Javascript provides us the facility to break a loop in middle and also to continue the loop without executing the whole body of the loop.There are two keywords that provides these facilities: 1) break 2) continue
0 votes
1k views

JavaScript Submit Event

This event is fired when the form is submitted. This is only works with the form element of the HTML.
0 votes
949 views

JavaScript Do While

Do…While loop is the varient of the while loop. The difference between while and do…while is that while loop only executes if the condition is true while do….while loop executes atleast once even the codition is false.
0 votes
876 views

JavaScript DOM setAttribute

We are here using Core DOM setAttribute method we set the value of input type text to button.