0

I am trying to integrate the following script in my html page, but so far I am not very successful. Is there any cleaner way to achieve this ?

        <script>
            $(function() {
                $('input:checkbox').change(function() {
                //$('#console-event').html('Toggle: ' + $(this).prop('checked'))
                event.preventDefault();
                console.log("Change event: " + this.id + "..." + this.checked);                         
                doSomething(this.id);
                <?php require('common.php');
                $result = $db->add_news('titles');
                }?>                                     })
                }
            )
        </script>
Laurent
  • 711
  • 2
  • 12
  • 30

0 Answers0