Thanks. I think I'm going to try a different tack. Ideally, I'd like to check to see if an object exists AND store a reference to that object at the same time. So I'll do this:
var redline = $('#redline'); if (!redline.size()) { // do some stuff here } Thanks for the point to size() daemach. That's better than the idea I had. -----Original Message----- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Daemach Sent: Wednesday, May 23, 2007 12:35 PM To: jQuery (English) Subject: [jQuery] Re: Boolean value for if an element exists var redlineExists = ($('#redlineSelect').size()) On May 23, 10:31 am, "Andy Matthews" <[EMAIL PROTECTED]> wrote: > I've got some multiple dropdowns that I'm trying to conditionalize. > Our designers can select one (or both) of two sets of code. I'd like > to conditionalize my jQuery code so that if the redline dropdowns > exist, I can run that code, or if the inventory dropdowns exist, I can run THAT code. > > Is there a way of assigning a boolean value using a jQuery call? > Something like this maybe? > > var redlineExists = $('#redlineSelect'); > > Where if the element is there, then redlineExists would be true, and > false if it did not? > > How might I do that? > > ____________________________________ > > Andy Matthews > Senior Coldfusion Developer > > Office: 877.707.5467 x747 > Direct: 615.627.9747 > Fax: 615.467.6249 > [EMAIL PROTECTED]<http://www.dealerskins.co > m/> > > dealerskinslogo.bmp > 6KDownload