countries DB logo

Documentation

:update Event Demo

This standalone example demonstrates listening to countriesWidget:update events to react to both user-initiated and widget-initiated changes (preselected, geoip, reload).

How it works: The widget dispatches countriesWidget:update events on the affected select element whenever the value changes, whether it is from user interaction, geolocation preselection, or programmatic updates.

Try it: Select a country and subdivision. The output below will update automatically using the event listeners.

Live Example

Output: (waiting for selection...)