Navigator 2.0, Internet Explorer 3.0; enhanced in Navigator 3.0
form.button_name form.elements[i]
A read-only reference to the Form object that contains the Button.
A read-only String, set by the HTML NAME attribute, that specifies the name of the button.
A read-only string that specifies the type of this form element. For Button elements, it has the value "button". Available in Navigator 3.0 and later.
A read-only String property, specified by the HTML VALUE attribute, which specifies the value displayed in the Button element.
A Button element is created with a standard HTML <INPUT> tag, with the addition of the onClick attribute:
<FORM> ... <INPUT TYPE="button" specifies that this is a button VALUE="label" the text that is to appear within the button specifies the value property [ NAME="name" ] a name that can later be used to refer to the button specifies the name property [ onClick="handler" ] JavaScript statements to be executed when the button is clicked > ... </FORM>
The Button element represents a graphical push button in a form within an HTML document. The value property contains the text that is displayed by the button. The name property is a name by which the button may be referred to. The onClick event handler is invoked when the user clicks on the button.
Use a Button element whenever you want to allow the user to trigger some action on your web page. You can sometimes use a Link object for the same purpose, but unless the desired action is to follow a hypertext link, a Button is a better choice than a Link, because it makes it more explicit to the user that there is something to be triggered.
Note that the Submit and Reset elements are types of Buttons that submit a form and reset a form's values. Often these default actions are sufficient for a form, and you do not need to create any other types of buttons.
<FORM name="form1"> <INPUT type="button" name="press_me_button" value="Press Me" onClick="name =index.html prompt('What is your name?',")" > </FORM>
file: /Techref/language/java/script/definitive/refp_20.htm, 8KB, , updated: 2019/10/14 15:00, local time: 2024/11/30 04:32,
18.189.184.99:LOG IN
|
©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions? <A HREF="http://massmind.org/Techref/language/java/script/definitive/refp_20.htm"> [Chapter 21] Reference: Button</A> |
Did you find what you needed? |
Welcome to massmind.org! |
Welcome to massmind.org! |
.