ComboBox demo code

By adding 2 lines of code, a Select element can be turned into a ComboBox. E.g.:

<script src="ComboBox.js"></script>

In the Body element: Specify a Select element with an ID and an optional onchange function. (This will be turned into a ComboBox.) In the Script element: Call CBMake on the Select element's ID. (This turns the Select into a ComboBox.) In the Script element (optional): Define the ComboBox's onchange function. (It will receive Select and Input events.) In a further Script element: Include ComboBox.js. Press Ctrl+U to see the demo code.