Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
86
rated 0 times [  90] [ 4]  / answers: 1 / hits: 17062  / 13 Years ago, fri, january 20, 2012, 12:00:00

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?


More From » jquery

 Answers
31

Try $('input:text, textarea')


[#87913] Wednesday, January 18, 2012, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
loganl

Total Points: 424
Total Questions: 86
Total Answers: 112

Location: Zimbabwe
Member since Thu, Jul 21, 2022
2 Years ago
;