Jump to content

hiding a specific label


jimfog

Recommended Posts

I have 4 input elements and 4 labels,one for each.

In addition each of these label elements have for attributes.

 

I want to target and hide a specific label, the one having for='"wwwaddress" but I cannot, instead all labels are hidden.

 

See the fiddle here:

http://jsfiddle.net/fiddlehunt/5rSdf/

 

What am I doing wrong?

Link to comment
Share on other sites

You are trying to hide the wwwaddress label when you target it? Or you just want to hide the wwwaddress input using Javascript?

Everything is done js.EITHER WAY.

 

I do not understand your first question.

I am just trying to hide the label, forget the input element for now

Link to comment
Share on other sites

I don't rememebr exactly what the jQuery attr() function does, but you probably are just setting the value of the for attribute to "wwwaddress" on all elements with class "label".

 

What you want to do is select the element that has attribute for="wwwaddress" so here's the proper selector: .label[for=wwwaddress]

Link to comment
Share on other sites

The problem now though, it is that the hidden element occupies the space in the form-it is seen as large empty space.

The goal is that the space is NOT occupied.

 

I FIXED..almost, if there is a problem I will repost.

Edited by jimfog
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...