//Select every second link const $odd = $('a:odd'); //Select all secure links const $secureLinks = $('a[href^="https://"]'); //Select all links that ends with .pdf const $pdfs = $('a[href$=".pdf"]'); //Add target blank attribute to every secure link $secureLinks.attr('target', '_blank'); //Make downloadable pdf-s instead of open it in the browser $pdfs.attr('download', true);
Leave a Reply