TAILIEUCHUNG - Học JavaScript qua ví dụ part 39

Tên của các đối tượng hình thức mà phần tử được định nghĩa (chỉ đọc). Tên của các thiết bị đầu vào theo quy định tại các tên thuộc tính HTML (chỉ đọc). Các loại thiết bị đầu vào, chẳng hạn như radio, hộp kiểm, mật khẩu, và như vậy (chỉ đọc). Một giá trị Boolean, nếu thật sự phần tử bị vô hiệu hóa để nó không thể được sửa đổi, thậm chí nếu nó chứa một giá trị, dữ liệu từ một trường mẫu khuyết tật không được gửi lại cho máy chủ. | 350 Chapter 11 Working with Forms and Input Devices Table Properties of the elements Object Property What It Describes form The name of the form object where the element was defined readonly . name The name of the input device as specified in the HTML name attribute read-only . type The type of input device such as radio checkbox password and so on read-only . disabled A Boolean value if true the element is disabled so that it can t be modified even if it contains a value data from a disabled form field is not sent back to the server. value The text that is associated with the input device such as the text entered into the text area or textbox the text that appears in a button and so on read write . Naming Forms and Buttons How JavaScript References a Form by name or id. The form tag has a name attribute that allows you to give your form a name. It is somewhat easier and more readable to reference a form by its name than by using the array syntax such as forms 0 and forms 1 . You will need the name attribute if you are submitting the form to a server-side program as discussed in Section . Any object including the form can also be referenced by using its unique ID and the getElementById method of the document standardized by the W3C DOM. In Example two HTML forms are created One contains a textbox and the other a button. Each of the forms is given a name with the name attribute and an id. In the JavaScript program the two forms are accessed by using the name and the id of the form and its elements. EXAMPLE html head title Naming Forms object title head body 1 form name form1 id first_form Enter your name 2 input type text id namefield name namefield value Name 3 form From the Library of JavaScript and the form Object 351 EXAMPLE continued 4 form name form2 id second_form 5 input type button value Press here 6 form big 7 script type text javascript DOM Level 0. How do we reference the form in JavaScript Go down the .

TỪ KHÓA LIÊN QUAN
TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.