Skip to main content
New Participant
March 18, 2008
Question

How to find a word in select text?

  • March 18, 2008
  • 1 reply
  • 355 views
if offer is in select text, i want display some message.
How can i find select text contains offer using JS?.

selObj.options[selIndex].text == "%offer%"
This topic has been closed for replies.

1 reply

Inspiring
March 19, 2008
Take a look at javascript's string functions or regular expressions for more complex searches. Just remember javascript is case sensitive.

http://www.w3schools.com/jsref/jsref_obj_string.asp
http://www.w3schools.com/jsref/jsref_obj_regexp.asp
Prasanth_Kumar_S
Inspiring
March 19, 2008
Hi,
Try using find or findnocase functions.
Prasanth