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>