【问题标题】:input:text + textarea selector in jqueryjquery中的输入:文本+文本区域选择器
【发布时间】:2012-01-20 02:04:48
【问题描述】:

我正在尝试这样做:

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

但是$('input:text','textarea') 不能用作选择器。我做错了什么?

【问题讨论】:

    标签: javascript jquery forms


    【解决方案1】:

    试试$('input:text, textarea')

    【讨论】:

      猜你喜欢
      • 2011-08-13
      • 2012-01-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-06-08
      • 2015-06-03
      相关资源
      最近更新 更多