How can I add an an <input type="text">
when a specific option between <select></select>
tags is selected, then, if another option is selected, delete that text field using jQuery?
相关问题
- How to fix IE ClearType + jQuery opacity problem i
- jQuery add and remove delay
- Include empty value fields in jQuery .serialize()
- Disable Browser onUnload on certain links?
- how to get selected text from iframe with javascri
If you want to display a then add it where you want and set it to display none and then get it from JQuery
then into your JS
To get the value of a
<select>
, use the.val()
method. To add/remove an element, there are several options. I will give you one of them example:You should make use of
change
event. Then you could compare the value for which you want to create the input and add it to thebody
or to any other element.Living example: http://jsfiddle.net/MKPdb/
Having a list like this, with the id
mylist
, for example:You could use this:
Living example: http://jsfiddle.net/MKPdb/