【问题标题】:How to add disabled attribute to an element using Google Closure?如何使用 Google Closure 向元素添加禁用属性?
【发布时间】:2015-12-17 11:09:12
【问题描述】:

我正在尝试使用 Google Closure 禁用 input 字段。谁能告诉我使用 Google Closure 执行该操作的语法是什么?

【问题讨论】:

    标签: google-closure google-closure-library


    【解决方案1】:

    可以使用 setAttribute() 函数禁用 google 闭包上的任何元素。

    /**
    * @type {Element}
    * @private
    */
    this.$title_ = null; // call getElementByClass('','') here;
    this.$title_.setAttribute('disabled', 'disabled');
    

    这里 this.$title 是一个输入元素。

    【讨论】:

      猜你喜欢
      • 2011-04-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-12-29
      • 1970-01-01
      • 2010-10-17
      • 1970-01-01
      相关资源
      最近更新 更多