I've browsed a few other questions on here with getting current page url with jQuery and/or plain javascript but I have been having no luck.
My goal is this: depending on what page the user is on, I want a border under that menu item. This is how I am attempting to do it:
var urlHome = 'http://example.com/'
var urlShop = 'http://example.com/shop/'
var urlTeam = 'http://example.com/team/'
if (document.url.is(urlHome)) {
$('#home-link').css('border-bottom', '1px solid #000');
}
else if (document.url.is(urlShop)) {
$('#shop-link').css('border-bottom', '1px solid #000');
}
else if (document.url.is(urlTeam)) {
$('#team-link').css('border-bottom', '1px solid #000');
};
Unfortunately this code isn't working for me, I'm open to any and all suggestions, thank you in advance for your help.
if (document.url == urlHome)etc.....isis a jquery function