Thứ Bảy, 24 tháng 8, 2013

[HTML] Bài 11.2 Biểu Mẩu - From

By Unknown   Posted at  18:51   HTML và CSS No comments


1. SELECT TAGS

Tag SELECT dùng để tạo danh sách lựa chọn, có nhiều kiểu danh sách
- Cú Pháp:
<select thuoctinh="giatri">
<option value=""> mục 1 </option>
<option value=""> mục 2 </option>
<option value=""> mục 3 </option>
<option value=""> mục 4</option>
</select>
+ Cặp thẻ <select> </select> khai báo 1 phiên làm việc với kiểu danh sách
+ Cặp thẻ <option></option>  bên trong cặp thẻ <select></select>
Tùy chọn kiểu danh sách bằng thuộc tính:
Thuoctinh=”giatri”
Mô tả
disabled="disabled"
Xác định danh sách thả xuống không hiển thị.
multiple="multiple"
Hiển thị nhiều tùy chọn.
name="selName"
Xác định tên cho danh sách lựa chọn.
size="30"
Xác định số tùy chọn có thể thấy trong danh sách lựa chọn.
P/s: đối với kiểu multiple bạn có thể chọn nhiều mục bằng cách bấm nút
Ctrl .
và chọn
Ví Dụ:
Kiểu Mặc định <br/>
<select>
<option value="Student">Student</option>
<option value="Bussiness">Bussiness</option>
<option value="Manager">Manager</option>
<option value="Other">Other...</option>
</select>
<br/>Kiểu Disabled <br/>
<select disabled="disabled">
<option value="Student">Student</option>
<option value="Bussiness">Bussiness</option>
<option value="Manager">Manager</option>
<option value="Other">Other...</option>
</select>
<br/>Kiểu Multiple <br/>
<select multiple="multiple">
<option value="Student">Student</option>
<option value="Bussiness">Bussiness</option>
<option value="Manager">Manager</option>
<option value="Other">Other...</option>
</select>
<br/>Kiểu Size <br/>
<select size="10">
<option value="Student">Student</option>
<option value="Bussiness">Bussiness</option>
<option value="Manager">Manager</option>
<option value="Other">Other...</option>
</select>
See the Pen %= penName %> by Nguyễn Hữu Trọng (@Rain) on CodePen
Ngoài ra bạn cũng có thẻ chèn thuộc tính vào từng option riêng.
Ví Dụ:
<select>
<option disabled="disabled" value="Student">Student</option>
<option>Bussiness</option>
<option value="Manager">Manager</option>
   <option value="Other">Other...</option>
</select>

2. Hộp Soạn Thảo Văn bản:

Khi vào 1 diễn đàn hay blog nào đó các bạn thường thấy những hộp soạn thảo văn bản giúp các bạn có thể bình luận bài viết, viết bài viết mới..v...v.. để tạo ra hộp thoại soạn thảo văn bản như vậy bạn sử dụng thẻ TEXTAREA.
-Cú Pháp:
<textarea cols="số cột" rows="số dòng" maxlength="số ký tự tối đa cho phép" thuoctinh="giatri">
Nội dung
</textarea>
 
Thuộc tính bắt buộc
Mô tả
cols="số"
Xác định chiều rộng hiển thị của <textarea>.
rows="số"
Xác định số hàng hiển thị của <textarea>.
Thuộc tính tùy chọn
Ví dụ
Mô tả
disabled="disabled"
Xác định vùng <textarea> không hiển thị.
name=" tên của textarea "
Xác định tên của <textarea>.
readonly="readonly"
Xác định vùng <textarea> chỉ được đọc.
 Ví Dụ:
<textarea rows="5" cols="20">Bạn đang xem tag html textarea, là text có thể nhập được văn bản, và có thể chứa rất nhiều dòng...</textarea>
 Bài Tập:


About the Author

Nulla sagittis convallis arcu. Sed sed nunc. Curabitur consequat. Quisque metus enim, venenatis fermentum, mollis in, porta et, nibh. Duis vulputate elit in elit. Mauris dictum libero id justo.
View all posts by: BT9

0 nhận xét:

Back to top ↑
Connect with Us

What they says

© 2013 abcdasdasd. WP Mythemeshop Converted by BloggerTheme9
Blogger templates. Proudly Powered by Blogger.