사용자 도구

사이트 도구


html:html5:form

문서의 이전 판입니다!


HTML5 Form

  • input 엘리먼트의 type 값이 다양해 졌다.
  • email : Email
  • url : URL
  • tel : 전화번호
  • search : 검색
  • ragne : 슬라이더(범위)
  • number : 숫자
  • date : 날짜
  • datetime : 날짜와 시간
  • color : 색상
  • autofocus : 자동포커스
    • FF 13에서 이상한 곳으로 자동 스크롤되는 경우가 있음
  • placeholder : input 영영에 안내 문구 넣기
  • contenteditable : input이 아닌 일반 엘리먼트에 지정하여 input 처럼 즉시 수정할 수 있게 한다.

HTML5 지원여부 검사

  • 각 타입별로 input 객체를 생성해서 type을 지정해보고 값을 입력해서 정확한 값이 들어가는지 테스트해볼 수 있다.
  • Modernizr를 통해 HTML5와 CSS3 최신 기법의 사용 가능성을 검사할 수 있다.

Color

  • 대체제 : jQuery SimpleColor
  • color 지원여부 검사
    function hasColorSupport() {
      input = document.createElement("input");
      input.setAttribute("type", "color");
      var hasColorType = (input.type !== "text");
      // handle Safari/Chrome partial implementation
      if(hasColorType){ // <label id="code.js.webkit" />
        var testString = "foo";
        input.value=testString;
        hasColorType = (input.value != testString);
      }
      return(hasColorType);
    }
html/html5/form.1342451823.txt.gz · 마지막으로 수정됨: 2012/07/17 00:17 저자 kwon37xi