lundi 23 mai 2016

Checkbox is changing value from unrelated jquery

I am really confused because I have a checkbox that is changing it's value when the text of a tooltip in a different table data cell is clicked and I can't understand why this is happening. This is my HTML:

<tr>
  <td scope="row">
    <label>My Label 
      <i class="fa fa-info-circle information-icon" aria-hidden="true"></i>
      <p class="hidden" style="display: block;">My Tooltip</p>
    </label>
  </td>
  <td>
    <input type="checkbox" value="1">
  </td>
</tr>

and this is my jquery:

$(".hidden").hide();
  $(".information-icon").click(function(event){
    event.preventDefault();
    $(this).next(".hidden").slideToggle();
});  

Any ideas of where I am going wrong. Thanks :)




Aucun commentaire:

Enregistrer un commentaire