vendredi 31 juillet 2015

How can I tie input checkbox to Javascript function?

I can't bind my checkbox result to Javascript code. How can I do this correctly? The script doesn't react to this.

application.js

$(document).on('ready page:load', function () {
 function setCheckbox() {
    $('.check').on('click', function complete(){
      alert("alert");
    }) }
})

view file

 <input type="checkbox" value="<% article.complete %>" class='check' data-remote="true" >




Aucun commentaire:

Enregistrer un commentaire