开发者

jquery select element with multiple attributes

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="blahblah@blah.com" name="Email" type="hidden">

<input value="blahblah@blah.开发者_JAVA百科com" 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?


$('input[type=hidden][name=Email]').remove();

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


$('input[name=Email][type=hidden]').remove()
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜