简体   繁体   中英

Simulate Clicking or Pressing Enter

I have an issue with one of my javascripts. Im using this code $('select[name="groupid"]').val('Crew Group').change('select#groupid'); to select from a drop down menu, but unless i click it, it doesnt change some variables and values on the page. How can i simulate clicking it or anything? Someone said change() but it didnt work using $('select[name="groupid"]').val('Crew Group').change(); either.

Any ideas? I would assume simulating a click or enter would work if thats possible?

This is what i see for change if anthing 在此处输入图片说明

尝试使用.trigger('change')

$('select[name="groupid"]').val('Crew Group').trigger('change');

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM