Thanks for the help... that should work just fine. I was just hoping there was some way to utilize those linked items with a single call.
On Oct 1, 12:08 pm, James <james.gp....@gmail.com> wrote: > I'm sure there are many ways to go about this. Here's one: > > var fieldName = 'FirstName'; > $("#"+fieldName).remove(); // removes input > $("label[for="+fieldName+"]").remove(); // removes label > > Assuming that your label will always have the same "for" as the ID of > the input. > > On Oct 1, 8:09 am, rob <rob.sche...@gmail.com> wrote: > > > I'm using a form in several places for this project. I don't want to > > duplicates of this form so I have it as an include file. Each page > > requires all the same fields, however, there is one page where I'd > > like to remove two fields. > > > <fieldset> > > <label for="FirstName">First Name</label> > > <input id="FirstName" /> > > </fieldset> > > > Is there a way to remove an input field and it's label by selecting > > the ID of the input field? > > > I looked at the JQuery doc, and there's a prev + next selector which > > shows $('label + input').css ... this will set css properties for an > > input element that follows a label element. > > > something like $('#FirstName > label + input').remove...