Selecting

后端 未结 2 1127
清酒与你
清酒与你 2021-02-10 03:26

I\'m hoplessly trying to activate a change() event from a chrome content script. I\'ve gone past through of the website and google posts, but still nothing works.

here\'

2条回答
  •  北海茫月
    2021-02-10 03:59

    I dont really know JQuery, but here's how to do it without JQuery and without injecting anything into the page....

    var selections = document.querySelector('#woot');
    
    selections.value = 17;
    
    var evt = document.createEvent("HTMLEvents");
    evt.initEvent("change", true, true);
    selections.dispatchEvent(evt);
    

提交回复
热议问题