Changes

Jump to navigation Jump to search
337 bytes removed ,  11:59, 10 June 2022
no edit summary
Line 1: Line 1: −
<html>
+
<form action="/action_page.php">
<head>
+
  <label for="cars">Choose a car:</label>
<title>dropdown menu using select tab</title>
+
  <select name="cars" id="cars">
</head>
+
    <option value="volvo">Volvo</option>
<script>
+
    <option value="saab">Saab</option>
function favTutorial() {
+
    <option value="opel">Opel</option>
var mylist = document.getElementById("myList");
+
    <option value="audi">Audi</option>
document.getElementById("favourite").value = mylist.options[mylist.selectedIndex].text;
+
  </select>
}
+
  <br><br>
</script>
+
  <input type="submit" value="Submit">
 
  −
<body>
  −
<form>
  −
<b> Select you favourite tutorial site using dropdown list </b>
  −
<select id = "myList" onchange = "favTutorial()" >
  −
<option> ---Choose tutorial--- </option>
  −
<option> w3schools </option>
  −
<option> Javatpoint </option>
  −
<option> tutorialspoint </option>
  −
<option> geeksforgeeks </option>
  −
</select>
  −
<p> Your selected tutorial site is:
  −
<input type = "text" id = "favourite" size = "20" </p>
   
</form>
 
</form>
</body>
  −
</html>
 

Navigation menu

GCwiki