Change button href to other href on page
<p>I have a website with a logout link. </p>

<pre><code>&lt;a href="http://specialuniquelogout.com"&gt;Logout&lt;/a&gt;
</code></pre>

<p>When someone clicks this link, a notification box pops up asking you "Are you sure you want to logout?". They can either press yes or no. If they press no, it closes the notification box. But I need to dynamically set the href attribute of the YES button to the href of the original logout link that they clicked.</p>

<p>I was thinking maybe I can somehow use <code>window.location = $this.attr('href');</code>
but can't figure it out. </p>

<p>Here is my code:</p>

<pre><code>&lt;a class="mb-control" data-box="#mb-signout" href="http://UNIQUELOGOUTLINK.com"&gt;Logout&lt;/a&gt;

&lt;!-- MESSAGE BOX--&gt;
        &lt;div class="message-box animated fadeIn" data-sound="alert" id="mb-signout"&gt;
            &lt;div class="mb-container"&gt;
                &lt;div class="mb-middle"&gt;
                    &lt;div class="mb-title"&gt;&lt;span class="fa fa-sign-out"&gt;&lt;/span&gt; Log &lt;strong&gt;Out&lt;/strong&gt; ?&lt;/div&gt;
                    &lt;div class="mb-content"&gt;
                        &lt;p&gt;Are you sure you want to log out?&lt;/p&gt;                    
                        &lt;p&gt;Press No if you want to continue work. Press Yes to logout current user.&lt;/p&gt;
                    &lt;/div&gt;
                    &lt;div class="mb-footer"&gt;
                        &lt;div class="pull-right"&gt;
                            &lt;a href="NEED TO PUT THE UNIQUE LOGOUT LINK HERE" class="btn btn-success btn-lg"&gt;Yes&lt;/a&gt;
                            &lt;button class="btn btn-default btn-lg mb-control-close"&gt;No&lt;/button&gt;
                        &lt;/div&gt;
                    &lt;/div&gt;
                &lt;/div&gt;
            &lt;/div&gt;
        &lt;/div&gt;
        &lt;!-- END MESSAGE BOX--&gt;

        &lt;!-- START PRELOADS --&gt;
        &lt;audio id="audio-alert" src="audio/alert.mp3" preload="auto"&gt;&lt;/audio&gt;
        &lt;audio id="audio-fail" src="audio/fail.mp3" preload="auto"&gt;&lt;/audio&gt;
        &lt;!-- END PRELOADS --&gt;   

&lt;script&gt;

/* PLAY SOUND FUNCTION */
function playAudio(file){
    if(file === 'alert')
        document.getElementById('audio-alert').play();

    if(file === 'fail')
        document.getElementById('audio-fail').play();    
}
/* END PLAY SOUND FUNCTION */

   /* MESSAGE BOX */
    jQuery(".mb-control").on("click",function(){
        var box = $($(this).data("box"));
        if(box.length &gt; 0){
            box.toggleClass("open");

            var sound = box.data("sound");

            if(sound === 'alert')
                playAudio('alert');

            if(sound === 'fail')
                playAudio('fail');

        }        
        return false;
    });
    jQuery(".mb-control-close").on("click",function(){
       $(this).parents(".message-box").removeClass("open");
       return false;
    });    
    /* END MESSAGE BOX */

&lt;/script&gt;

&lt;style&gt;
.message-box {
    display: none;
    position: fixed;
    left: 0px;
    top: 0px;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
}

.message-box.open {
    display: block;
}

&lt;/style&gt;
</code></pre>

<p>Thanks to anyone who can help!</p>