I wanted to check if all links of a page have https:// or they just start with www. and if they don't have https:// just add it to them
I'm stuck in the condition to check if they have https: or not and how to add them https:
$('.rest-web a').each(function(){
console.log($(this).attr('href'));
var link = $(this).attr('href');
if(link.location.protocol !== 'https:'){
console.log('no');
} else {
console.log('yes');
}
});
Many thanks