Works great!  Thanks!

 

Matt Penner
Database Engineer II
GIS Support
[EMAIL PROTECTED]
(951) 940-6108 x10709

________________________________

From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Karl Swedberg
Sent: Wednesday, November 07, 2007 12:27 PM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: Would be nice to select objects using attribute
comparisons

 

You could try something like this (untested):

 

$('#mySelect option').filter(function() {

    return parseInt(this.value, 10) > 5;

})





 

--Karl

_________________

Karl Swedberg

www.englishrules.com

www.learningjquery.com

 





 

On Nov 7, 2007, at 2:33 PM, Penner, Matthew wrote:





I have several options in a select element, each whose value is an
integer.

 

I would love to be able to select those above a threshold, such as
something like:

$("#mySelect option[value>5]")

 

I know I can do this with :gt(index) but I'd rather use the actual value
for less hard coding and better readability.  I think this would great
in other areas too.

 

I'm sure there are lots of issues with this since the value is really
just text, but a straight string comparison would probably do.

 

Anyway, just my vote.

 

Let me know if there is a better place to suggest this.

 

Thanks,

Matt Penner




 





 

Reply via email to