我正在创建一个网站。我有一个页面,其中有一个下拉列表,我想这样做,以便当用户选择“其他”选项时会出现一个文本框。我怎么做?
这是我的代码:
<!DOCTYPE html>
<html>
<html lang = "en">
<body>
<p id="demo"></p>
<h1>What would you like it to say?</h1>
<p>Commmon Requests:</p>
<form action="input" action="random.html" method="get">
<select name="requests">
<option value="blank"> </option>
<option value="good morning sir">Good Morning Sir</option>
<option value="good morning madam">Good Morning Madam</option>
<option value="other">Other</option>
<input type="submit" value="Submit">
</select>
</form>
<br><br><textarea rows="3" cols="30">
Write a request here if you would like to hear it.
</textarea>
</body>
</html>