I've been trying to implement a JS call from a seperate script and despite referencing m,ultiple demo I cannot get my example to work.
Can someone help me trouble shoot this simple example?
tescript.php says
<!DOCTYPE HTML>
<!-- Load checkout JS -->
<script type="text/javascript" src="tscript.js"></script>
<div class="col-md-3 col-sm-4 col-xs-12 imageUploadSide">
<ul>
<li> <button id="buyingPhoto" class="btn btn-buy">A New Buyit Button</button>
</li>
</ul>
</div>
Then the script file says
// checking script load & log
console.log("script file has been loaded")
$('#buyingPhoto').on('click', function() {
console.log("Can a button be depressed?")
});
I get a console log that the script has loaded (troubleshooting step 1) but the onclick itself doesn't run
</body>at the end of your page or at least after your HTML.