I don't know how to phrase my question, so here's more of an explanation... Problem I need to solve: Only display this script on pages A, B and C. They are wordpress pages so I can't just paste the script into each page. I wrote this script:
if(window.location.href.indexOf("url-string-a") > -1){
jQuery( "form" ).addClass( "active" );
}
but I don't know how to apply it to more than one URL without copy and pasting this 3 times. (In my actual scenario, this script needs to run on 10 pages, so I don't want to copy and paste this 10 times. I'm sure there's a cleaner way of doing this.)
Thanks!