Script for a DropdownBox

I am trying to make a combobox. This is what I want in the form.
<select name=“ampm”">
<option value=“12p\”>PM</option>
<option value=“0”>AM</option>
</select>

This part works the dropdownbox appears.

I am having trouble producing the value from the “ampm” selection in the <script> section. Looking for something like this except for a selectbox:

var time=number(window.document.myform.ampm.value);

This works. Just change the alert to do what you want to do.
<html>

<head>

<script type=“text/javaScript”>
<!–
function process(obj)
{ // check if invalid selection
if(obj.selectedIndex==0){return;}
// if OK show value of selected option
alert(obj.options[obj.selectedIndex].value)
}
//–>
</script>
</head>

<body>

<p><select name=“ampm” onchange=“process(this)”>
<option selected>Select AM/PM</option>
<option value=“AM-value”>AM</option>
<option value=“PM-value”>PM</option>
</select> </p>

</body>

</html>