I have a variable in PHP called $total = $db['total'];
now I want to grab that in Jquery so I do
<script>
$(function() {
console.log("<?php echo $total; ?>");
});
</script>
but I get some nonsense like console.log("<div style="border:1px solid #990000;padding-left:20px;margin:0 0 10px 0;"> throws error uncaught syntaxError: Unexpected identifier. What am I doing wrong?