GEOG 863
GIS Mashups for Geospatial Professionals

7.2.3 Button

PrintPrint

The next sample also makes use of the select element (three of them, actually), but unlike the previous sample, the script’s main logic isn’t carried out until a button is clicked. The button is created on line 260 as an HTML button element, and as seen in prior samples, is assigned an id. As in the previous sample, an event listener is defined using the on and dom modules. In this case, the listener is set up on the button’s click event. References to the three select elements are established on lines 159-161; they are then used to retrieve the selected options on line 181.