Html Dropdown Help??????????????

Andy

New member
I have a dropdown list like this:
<select align="left" id="list">
<option>File</option>
<option>Save</option>
</select>

And i want it so when you click on the save tab it runs a function.
And please give example, not website link!
 
Here is some code, pardon if is is messy,

<html>
<body>
<script language=javascript>
function alertUser(){
alert(document.form.name.value);
}
</script>
<form name=form>
<input type=text name=name >
<br>
<input type=button name=button value="Click Me">
</form>

</body>
</html>
 
actually you need write events to call the appropriate function, and call the javascript function from that event, see the following
<script language="javascript>
function go(val) {
alert("selected option = "+val);
}

</script>


<select align="left" id="list" onchange="go(this)>
<option value="file">File</option>
<option value="save">Save</option>
</select>
 
Back
Top