Search code examples
javascriptjquerytargettargeting

Hide a video in a button, upon click have the video open in the same window?


 <div class="learnmore">
    <a href="https://linktovideo"    target="_self"
 onclick="window.open('https://linktovideo','_self','width=600,height=600');
 return false;" class="learn-btn">
     Watch Video
     </a> 
 </div>

Im still learning jQuery, but currently this is still opening the link in a new window. I thought applying the "_top" attribute opens the window on the current page. Is target_top not compatible with jQuery or am I over thinking this, thank you stack for any help!


Solution

  • Is there a specific reason you're trying to use jquery or javascript for this task? Simple html code will get what you want I believe.

    <div class="learnmore">
        <a href="https://d25ixnv6uinqzi.cloudfront.net/year3/uotw74.3.mp4"  target="_self" class="learn-btn">
         Watch Video
         </a> 
     </div>