[jQuery] Re: Selecting Form Element Labels

2009-10-01 Thread rob
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 wrote: > I'm sure there are many ways to go about this. Here's one: > > var fieldName = 'FirstName'; > $("#"+fieldName).remove();  

[jQuery] Re: Selecting Form Element Labels

2009-10-01 Thread James
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