HTML/CSS

input tag의 type에 따른 css 적용.

부니기 2008. 2. 13. 02:06
input tag의 type에 따른 css 적용을 다르게 하는 방법 !!
crossbrowsing은 테스트 안했습니다. ^^;;;

첫번째 방법.

css
  - input {border:1ps solid red;}
  - input[type=radio] {border:none;}
  - input[type=checkbox] {border:none;}

두번째 방법

css
  - input {border:1px solid red;}

js
  - if(navigator.appVersion.indexOf('MSIE 6.0') != -1) {
        var input  = document.getElementsBytagName('input');
       
        input.each(function(input) {
             var type = input.getAttribute('type');
             if (type == 'radio' || type == 'checkbox') {
                 this.style.border = 0;
             }
        }
    }