Hakan
Hakan

Reputation: 3885

input:text + textarea selector in jquery

I am trying to do this:

$('input:text','textarea').focus(function () {
$(this).removeClass('wrong');
if (this.value == this.defaultValue){
$(this).val('');
}

But $('input:text','textarea') wont work as a selector. What am I doing wrong?

Upvotes: 12

Views: 17291

Answers (1)

Paul
Paul

Reputation: 2206

Try $('input:text, textarea')

Upvotes: 25

Related Questions