Make checkbox label clickable

Hi,

I have the following code

      <div class="col-md-12">
      <div class="show-password">
      <input type="checkbox" id="show-hide-password" />
	  <label for="show-hide-password" id="show-hide-password-label">Show Password</label>
			</div>
	  </div>

However, I would like the checkbox to become selected when the label is clicked.

Is this possible?

It should just work if you have matching id and for attributes, as you appear to have.

It doesn’t seem to check the box if it’s clicked though :confused:

It seems to be working for me.

Yes works for me also:)

We’d need to see an example where it doesn’t work unless this is a specific browsers issue so more details are required :slight_smile:

Thanks, I figured out that I had a pointer-event on the checkbox.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.