- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
$('input').each(function () {
if ($(this).attr('type') == 'text') {
this.className = 'textInput';
}
if ($(this).attr('type') == 'password') {
this.className = 'passwordInput';
}
});
$('textarea').each(function () {
this.className = 'textarea';
});
if ($(this).attr('type') == 'text') {
this.className = 'textInput';
}
можно заменить на
$('input:text').addClass('textInput');
А текстарея обойдется без класса, можно описать и по тегу.