[gray]// populate the existing select with id se, its current content will be removed[/gray]
[gray]// specify a JSON-like string containing the options' data ( may come directly from the responseText of an XMLHttpRequest )[/gray]
[gray]// in the options' data just enumerate the new values[/gray]
[COLOR=darkgoldenrod]mkselect[/color][teal]([/teal][green][i]'se'[/i][/green][teal],[/teal][green][i]'["Tek","Tips","Rulez"]'[/i][/green][teal])[/teal]
[gray]// create a new select and make it child of the element passed by reference[/gray]
[gray]// pass the options' data as an object[/gray]
[gray]// set the name of the select to the specified one[/gray]
[gray]// in the options' data enumerate objects containing the new texts and values[/gray]
[COLOR=darkgoldenrod]mkselect[/color][teal]([/teal]document[teal].[/teal]forms[teal][[/teal][purple]0[/purple][teal]],[/teal][teal]{[/teal][green][i]'name'[/i][/green][teal]:[/teal][green][i]'whatever'[/i][/green][teal],[/teal][green][i]'option'[/i][/green][teal]:[[/teal][teal]{[/teal][green][i]'text'[/i][/green][teal]:[/teal][green][i]'one'[/i][/green][teal],[/teal][green][i]'value'[/i][/green][teal]:[/teal][green][i]'first'[/i][/green][teal]}[/teal][teal],[/teal][teal]{[/teal][green][i]'text'[/i][/green][teal]:[/teal][green][i]'two'[/i][/green][teal],[/teal][green][i]'value'[/i][/green][teal]:[/teal][green][i]'second'[/i][/green][teal]}[/teal][teal]][/teal][teal]}[/teal][teal])[/teal]