How can I get the href value of clicked element?
<p>Here is my code:</p>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;
&lt;script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"&gt;&lt;/script&gt;
&lt;script src="https://cdn.rawgit.com/makeusabrew/bootbox/master/bootbox.js"&gt;&lt;/script&gt;

&lt;link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" /&gt;

&lt;a onclick="return bootbox.confirm('are you sure?', function(e){ if (e) {window.location = this.href;} });" href="/Remove-Post/{{ $tb }}/{{$post-&gt;id}}" data-toggle="modal" data-target="#confirm-delete"&gt;Link&lt;/a&gt;</code></pre>
</div>
</div>
</p>

<p>Noted that I use <a href="http://bootboxjs.com/" rel="nofollow noreferrer">this library</a> for <code>confirm</code>.</p>

<p>But this line doesn't work in my code:</p>

<pre><code>window.location = this.href;
</code></pre>

<p>And it always <em>(when I click <kbd>OK</kbd>)</em> redirects me here:</p>

<pre><code>http://localhost:8000/undefined
</code></pre>

<p>How can I fix it?</p>