Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Select checkbox with button

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #204964
    jacogrinwis
    Participant

    I want to select a checkbox with a button. For example, with a value of ‘abonnementen’ inside a wrapper div with class of ‘categorie’.
    http://codepen.io/anon/pen/jPxRxZ
    Sorry for my bad English

    #204967
    Shikkediel
    Participant

    This seems to work :

    $('.gereedschap-spec button').click(function() {
    
      var valuname = $(this).attr('class');
    
      $('input:checkbox[value="' + valuname + '"]')
      .prop('checked', true);
    });
    
Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.