Reputation: 1877
I used Jquery to select two elements and hide them with their attributes by the following:
$('input[name=login]').hide();
$('span[class=forgot]').hide();
Both lines properly selects the desired elements and hide them well in FF and IE. However in chrome, the selector is not picking up the object. Anything I should do differently?
Upvotes: 1
Views: 1975
Reputation: 1877
Thanks guys, turns out there is some issue with me referencing the Jquery library.
I do not know what is the reason, but referencing the library does not seem to be working.
After I copy pasted the entire Jquery Js file into the code. Everything works.
Again Thanks all for your help.
Upvotes: 0
Reputation: 28578
You should try:
$(document).ready(function(){
$("input[name='login']").hide();
$('span.forgot').hide();
});
Upvotes: 0
Reputation: 680
look for console errors in developer tool.
you can try with
jQuery('input[name=login]').hide();
jquery('span[class=forgot]').hide();
Upvotes: 0
Reputation: 73
For the span selector, you can use:
$('span.forgot').hide();
As for the input, you can use:
$('input[name="login"]').hide();
Upvotes: 0
Reputation: 3127
It may be that you're missing quotes:
$('input[name="login"]').hide();
Also, for classes, you might as well use the native selector:
$('span.forgot').hide();
Upvotes: 2
Reputation: 3711
You should use:
$('input[name="login"]').hide();
$('span[class="forgot"]').hide();
(note the additional quotes)
Upvotes: 3