snnlankrdsm
snnlankrdsm

Reputation: 1401

how can i remove checkboxes text

i can simply remove checked checkboxes with this code

  $(".ImdbAddArtist:checked").slideUp('slow');

however, i cannot delete checkbox's texts

How can i do that ?

For example

   <input type="checkbox" value="1500-374-Tom Cruise" class="ImdbAddArtist" name="artist[]">Tom Cruise

for example, when i remove with this code

  $(".ImdbAddArtist:checked").slideUp('slow');

It only removes checkboxes.How can i remove also text? In example, it's Tom Cruise

Upvotes: 2

Views: 622

Answers (1)

Andy Gaskell
Andy Gaskell

Reputation: 31761

Wrap it in a label. The nice thing about wrapping in a label is that the label will be clickable as well.

<label id="myLabel"><input type="checkbox" value="1500-374-Tom Cruise" class="ImdbAddArtist" name="artist[]">Tom Cruise</label>

Upvotes: 4

Related Questions