Thuộc tính của Form trong HTML5 | HTML5 Form Attributes

Cập nhật lần cuối 18/03/2017 by trong HTML&CSS vào 14/10/2013 có 1322 Views

Hiện tại HTML5 đã giúp ích cho chúng ta rất nhiều trong việc thiết kế web. một trong những hữu ích to lớn đó phải kể đến là HTML FORM Attributes

HTML5 Form Attributes là gì? Đó là là những thuộc tính trong form mà ta định nghĩa, trước đây cần sự hỗ trợ của java nhưng bjo ta có thể dùng luôn HTML5. Việc thiết kế sẽ gọn nhẹ và thuận tiện hơn rất nhiều ….

DEMO

Bjo chúng ta sẽ bắt đầu tìm hiểu các thuộc tính cơ bản nhé ^^

Searchtimedatetime
Emailweekdatetime-local
Urlmonthcolor
Teldate
Numberrange

TYPE search:

<input type="search" name="search">

TYPE email:

<input type="email" name="email" required />

TYPE url:

<input type="url" name="url" required />

TYPE tel: chỉ trong ứng dụng Iphone và android

<input type="tel" name="tel" required />

TYPE number:

<input type="number" name="test-number" min="5" max="22" required />

Hoặc

<input type="text" name="test-number" pattern="[0-9]*" required />

TYPE time:

<input type="time" name="test-time" required />

TYPE week:

<input type="week" name="test-week" required />

TYPE month:

<input type="month" name="test-month" required />

TYPE date:

<input type="date" name="test-date" required />

TYPE range:

<input type="range" name="test-range" min="1" max="100" value="0" required />

TYPE datetime:

<input type="datetime" name="test-datetime" required />

TYPE datetime-local:

<input type="datetime-local" name="test-datetime-local" required />

TYPE color:

<input type="color" name="test-color" required />

Chúc các bạn thành công!

5/5 - (1 vote)
  • Bình luận
Sản phẩm nổi bật của Toản
x