I noticed that in Google Chrome, the <option> setting selected with Javascript does not trigger the corresponding <select> tag change event.
<option>
<select>
Can I assume that this behavior is true in all other modern browsers?
Setting an option selected using JavaScript or selecting an option by focusing, and then using the up and down buttons to select it, is not accepted as an event by the onchange() event handler, as can be seen from the following links:
onchange()
PS: A similar situation arose when I tried to call <element onmousedown="doStuff();"> by calling element.click();
<element onmousedown="doStuff();">
element.click();
Setting any value for any field in JavaScript should not trigger any events.
If they did, you would end up in an endless cycle of events.
If you want, you can manually trigger the change event.
Yes, that must be true. In my experience, this works in IE 6, Chrome, FF, and Safari. I would agree that testing in all browsers that you intend to support is reasonable!
option: selected yes it works I just used it myself. Even supported in IE 6 - IE 8 webkit and FF
Source: https://habr.com/ru/post/1313971/More articles:Is SQL Server the equivalent of MySQL multi-trunk replication? - mysqlSmalltalk Exotic Features - smalltalkConfirmation of the field in the field "City / Country" - ruby | fooobar.comFlex Interface method createAutomationIDPartWithRequiredProperties error - flex3What gives you a dynamic language like python? Based on C # / java background. show me the light! - pythonAccess NSManagedObject fields using KVC / valueForKey vs properties - which is better? - coding-styleScheme When to use Symbols instead of strings? - streamWhat is an efficient algorithm for copying pixels inside a quadrilateral? - algorithmHow to check file upload area? - phpGoogle app for Google I / O applications - androidAll Articles