Determine if a value is an option in a select element with jQuery
To determine if an html select box contains a given value as an option, in jQuery you can try to select the option and see if it exists:
if($("#id option[value='someval']").length != 0)
{
// it exists!
}
That’s it! Have fun!
Recommended reading:
Leave a Reply
Sponsored Links
Fourth Woods Blog
Categories
- Culture and Copyright (1)
- Database (5)
- MySQL (1)
- Oracle (2)
- SQL Server (2)
- Emulation (1)
- Programming (41)
- Algorithms (4)
- C (11)
- Cpp (3)
- Design Patterns (1)
- Graphics (7)
- Java (4)
- JavaScript (9)
- JSP (1)
- Multimedia (5)
- Perl (1)
- Security (4)
- XML (1)
- Tips and Tricks (22)
- Uncategorized (2)
Tags
beginner
binary analysis
bufferoverflow
bug
bugs
c
cd
cdt
configuration
copyright
cpp
data
database
directx
disassember
eclipse
emulator
expert
explorer
facebook
factory
firefox
graphics
intermediate
iso
java
javascript
jquery
linux
maze
midi
mingw
multimedia
opengl
oracle
programming
screensaver
security
sql
sql server
tips
ubuntu
web development
windows
xml
