Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 jQuery 上我可以做 $('#idOfSelectTag').val('someValue');
如何在谷歌关闭中做同样的事情?
最接近的等价物是:
goog.dom.forms.setValue( goog.dom.getElement('idOfSelectTag'), 'someValue');
感谢来自关闭邮件列表的 Derek Slager。正确的方法:
goog.dom.forms.setValue(goog.dom.getElement('idOfSelectTag'),'someValue');