On Nov 6, 1:34 pm, Evan <[EMAIL PROTECTED]> wrote: > I want to run the JQuery script that is in the "value" attribute of my > <option> tags, when they are selected. I know to use onchange="" and > probably 'this', but how do I get the string in the value tag to run > as a function? > > <select name="Add Criteria" onchange=""> > <option value="$('#associate').removeClass('hidden');">Associate</ > option> > <option value="$('#company').removeClass('hidden');">Company</ > option> > </select> > > I feel like this should be simple, but I haven't been able to figure > it out. > > I would be very appreciative of any help anyone can give me. > > Thank you very much!
How about: $(document).ready(function () { $('select[name="Add Criteria"]').change(function () { if (this.value) { $('#'+this.value).removeClass('hidden'); } }); }); and: <select name="Add Criteria"> <option value="associate">Associate</option> <option value="company">Company</option> </select> -Eric