views:

137

answers:

2

Ok..i'm having a brainfart right now with jquery's selector process (yes, it's quite confusing to start).

I have 2 input elements on the page, of which I want to remove one.

here are my inputs:

<input value="[email protected]" name="Email" type="hidden">

<input value="[email protected]" id="Email" name="Email" type="text">

I have a blur method on #Email that will remove the hidden Email field. Unfortunately, I'm having a hard time targeting it to remove it.

Can someone help relieve my brainfart? I tried using :not, multiple attributes, etc. The hidden field is server generated and I can't stop it from being sent back.

Thoughts?

+2  A: 
$('input[type=hidden][name=Email]').remove();

should do. You can learn more about jQuery selectors here.

BalusC
+1  A: 
$('input[name=Email][type=hidden]').remove()
Keith Rousseau
freakin' awesome! thank you keith and balusC! I'm getting better with jQuery everyday with the help of the SO community!
Loony2nz