如何在HTML中引用标记值
我有以下代码:如何在HTML中引用标记值,html,forms,select,input,Html,Forms,Select,Input,我有以下代码: <select name ="selected"> <option> Option1 </option> <option> Option2 </option> </select> <input name = "text" type = "text" value = "The value of the selected value of the drop d
<select name ="selected">
<option>
Option1
</option>
<option>
Option2
</option>
</select>
<input name = "text" type = "text" value = "The value of the selected value of the drop down list"/>
选择1
选择2
如何在文本的值中引用选中的的值?您可以使用jQuery
alert(值为“+$”('select[name=“selected”]”).val());
要给出一个稍微扩展的答案,结合一些评论中已经说过的内容,有几件事你应该知道:
我建议你去看看网络基础课程,这可能会对你有很大帮助。你需要使用JavaScript,因为HTML是一种静态语言。如果你需要,请使用JavaScript。Ohkay thankx我会研究它!