tailieunhanh - Javascript bible_ Chapter 09

Tham khảo sách 'javascript bible_ chapter 09', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | Forms and Form Elements Most interactivity between a Web page and the user takes place inside a form. That s where a lot of the cool HTML stuff lives text fields buttons checkboxes option lists and so on. As you can tell from the by now familiar object hierarchy diagram refer back to Figure 8-1 a form is always contained by a document. Even so the document object must be part of the reference to the form and its elements. The Form Object A form object can be referenced either by its position in the array of forms contained by a document or by name if you assign a name to the form in the FORM tag . Even if only one form appears in the document it is a member of a one-element array and is referenced as follows 0 Notice that the array reference uses the plural version of the word followed by a set of square brackets containing the index number of the element zero always being first . But if you assign a name to the form simply plug the form s name into the reference Form as object and container A form has a relatively small set of properties methods and event handlers. Almost all of the properties are the same as the attributes for forms. Navigator allows scripts to change these properties under script control Internet Explorer allows this only starting with Version 4 which gives your scripts potentially significant power to direct the behavior of a form submission in response to user selections on the page. A form is contained by a document and it in turn contains any number of elements. All of those interactive elements that let users enter information or make selections belong to the form object. This relationship mirrors the HTML tag In This Chapter What the form object represents How to access key form object properties and methods How text button and select objects work How to submit forms from a script How to pass information from form elements to functions 2 Part II JavaScript Tutorial organization where items such as INPUT .

TỪ KHÓA LIÊN QUAN