Adding JS to one page
Create a new dir and file dedicated to your javascript. /js/scripts.js. Wrap your entire javascript like this: ( function( $ ) { var allStates = $(“svg.us > *”); allStates.on(“click”, function() { allStates.removeClass(“on”); $(this).addClass(“on”); }); } )( jQuery ); Then in your theme’s functions file, put this code. It loads your new js file. function your_scripts() … Read more