<html><script type="text/javascript">
function show()
{
alert("Your car is :"+getElementById("sel").value)
}
</script>
<select id="sel" onchange="show()">
  <option value ="volvo">Volvo</option>
  <option value ="saab">Saab</option>
  <option value="opel">Opel</option>
  <option value="audi">Audi</option>
</select></html>

解决方案 »

  1.   

    回2楼
      document加在哪?
      

  2.   

    alert("Your car is :"+document.getElementById("sel").value)
      

  3.   

    <html><script type="text/javascript">
    function show()
    {
    alert("Your car is :"+document.getElementById("sel").value)
    }
    </script>
    <select id="sel" onchange="show()">
      <option value ="volvo">Volvo</option>
      <option value ="saab">Saab</option>
      <option value="opel">Opel</option>
      <option value="audi">Audi</option>
    </select></html>