I have included jquery directly from CDN like
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> .
I have included my javascript file in the footer like
<script type="text/javascript" src="<?php echo get_template_directory_uri();?>/javascript/tsblog.js"></script>
my javascript code is
jQuery( document ).ready(function($) {
console.log( "ready!" );
$("#start-reading").click(function() {
console.log("click");
});
});
One simple jQuery click function. Here in the console i can see the ready message. but on clicking the element with id start-reading nothing is happening.
Here is the markup
<button id="start-reading">
</button>
I'm new to wordpress , is there something wordpress realted which i'm doing wrong ? Because this is supposed to work in non-wordpress environment.