Suppose a list of options is available, how do you update the <select>
with new <option>
s?
相关问题
- 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
For some odd reason this part
from CMS solution didn't work for me, so instead of that I've simply used this
And it's works. So my working code now looks like that:
if we update
<select>
constantly and we need to save previous value :Old school of doing things by hand has always been good for me.
Clean the select and leave the first option:
If your data comes from a Json or whatever (just Concat the data):
My Json Objetc:
This solution is ideal for working with Ajax, and answers in Json from a database.