목차

HTML5 Form

HTML5 지원여부 검사

Color

autofocus

function hasAutofocus() {
  var element = document.createElement('input');
  return 'autofocus' in element;
}
 
$(function(){
   if(!hasAutofocus()){
     $('input[autofocus=autofocus]').focus();
   }
});

placeholder

function hasPlaceholderSupport() {
  var i = document.createElement("input");
  return "placeholder" in i;
}

contenteditable

if (document.getElementById("요소ID").contentEditable != null) {
  // content editable을 지원할 때 하는 작업
}

multiple