For some reason my button isn't calling the script and Chrome's Console replies with the error "Unexpected token }"
Here is the script:
<script type="text/javascript" src="js/jquery-1.10.2.min.js">
function printContent(el){
var restorepage = document.body.innerHTML;
var printcontent = document.getElementById(el).innerHTML;
document.body.innderHTML = printcontent;
window.print();
document.body.innderHTML = restorepage;
}
</script>
Here is my button:
echo '<center>
<button onclick="printContent("printable");" class="btn btn-default">
<span class="glyphicon glyphicon-print"></span> Print
</button>
</center> ';
The reason for the echo is cause I am using PhP to call the button depending on the situation.
The div it's suppose to be printing looks something like this:
<div class="container" id="printable">
onclick="printContent(\'printable\');"