jquery onclick link to url code example
Example 1: onclick url
<button onclick="location.href='logout.php';">logout</button>
Example 2: click a link using jquery
$("a").trigger("click");
Example 3: onclick open link js
window.open(url);
<button onclick="location.href='logout.php';">logout</button>
$("a").trigger("click");
window.open(url);