jquery - Add new items to a Html selectbox -
Can I check in the html selection box for existing items, while adding them The user types a text in an input box and then clicks the button to add the item. But before I connect, I want to check identical objects, is there an effective method of writing this script?
if $ ('# dropdown option [Value =' + newoption + ']')
An option returns or not.
Example
if ($ ('# dropdown option [value =' + new + + ']'). Length & gt; 0) {// options exist . } And {// options do not exist}
Comments
Post a Comment