admin管理员组

文章数量:1195311

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?

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?

Share Improve this question edited Sep 29, 2012 at 14:36 Eli 14.8k5 gold badges61 silver badges77 bronze badges asked Jan 20, 2012 at 2:04 HakanHakan 3,88514 gold badges46 silver badges66 bronze badges 0
Add a comment  | 

1 Answer 1

Reset to default 25

Try $('input:text, textarea')

本文标签: javascriptinputtexttextarea selector in jqueryStack Overflow