开发者

How to select dropdown item (select option) in google closure?

开发者 https://www.devze.com 2023-01-28 08:03 出处:网络
on jQuery i could just do $(\'#idOfSelectTag\').val(\'so开发者_如何学编程meValue\'); How to do the same in google closure?The closest equivalent would be:

on jQuery i could just do $('#idOfSelectTag').val('so开发者_如何学编程meValue');

How to do the same in google closure?


The closest equivalent would be:

goog.dom.forms.setValue(
    goog.dom.getElement('idOfSelectTag'), 'someValue');


Thanks to Derek Slager from closure mailing list. The correct way :

goog.dom.forms.setValue(goog.dom.getElement('idOfSelectTag'),'someValue'); 
0

精彩评论

暂无评论...
验证码 换一张
取 消