Href using JS

<!–Html–>
<div class=”bottom-content js-footer-learn-more”>
Content
</div>

<!–JS–>
$(‘.js-footer-learn-more’).click(function(){
var url = $(this).data(‘url’);
window.location = url;
});

<!–CSS–>
.bottom-content {
cursor: pointer;
}

 

 

New rule of JSĀ  (Uisng function)

$(document).ready(function(){
var core = new SITE_CORE();
core.footerBannerClick();
});

SITE_CORE.prototype.footerBannerClick = function(){
$(‘.js-footer-learn-more’).click(function(){
var url = $(this).data(‘url’);
window.location = url;
});
};

 

Leave a Reply

Your email address will not be published. Required fields are marked *