본문 바로가기

Local Oriented/jQuery

[모음글] Type

http://findfun.tistory.com/422



아래와 같이 type 을 체크할 수도 있다.

  $('input[name="name1"], select[name="name1"], textarea[name="name1"]').each(function(){

    var t1 = this.type;

    if(t1=='text'){

      alert(t1);

    }else if(t1=='hidden'){

      alert(t1);

    }else if(t1=='radio'){

      alert(t1);

    }else if(t1=='checkbox'){

      alert(t1);

    }else if(t1=='image'){

      alert(t1);

    }else if(t1=='select-one'){

      alert(t1);

    }else if(t1=='textarea'){

      alert(t1);

    }

  });