"go to home page on logo click using js (site url"
Bootstrap 4.1.1 Snippet by soumen

<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <!------ Include the above in your HEAD tag ----------> <h1>go to home page in js</h1> <div>Go by:</div> <button onclick="go1()">window.open</button> <a href="#" onclick="go2()">window.location.href</a> <button onclick="go3()">location</button>
var url = window.location.origin = window.location.protocol + "//" + window.location.hostname + (window.location.port ? ':' + window.location.port: ''); function go1() { window.open(url) } function go2() { window.location.href = url } function go3() { location = url } window.go1 = go1; window.go2 = go2; window.go3 = go3;

Related: See More


Questions / Comments: