Modify paging with JS to create link

Asked

Viewed 94 times

0

I need to modify a page so that it offers a link to a run a video on an external play...

My current script:

(function() {
    'use strict';

   var tag = document.querySelector("video source").src;
   //location.href=tag;
   //window.locationf=tag;
   document.getElementById("wrapper").innerHTML = "<a href='' id='link'>Assita o EP via Player Externo</a>";
   document.querySelector("script").src = "a";
})();

This is the page I want to modify: http://showpl.tk/a9809

  • The script needs to get the src link from the TAG "video"...

    //var tag = Document.querySelector("video source"). src;

  • The script has to remove from the page...

    //Document.getElementById("wrapper"). innerHTML = "Watch the EP via External Player";

  • The script has to use the value of the TAG variable in the HREF field of the link with ID=LINK...

    //I don’t know how to modify...

1 answer

1


How do you already own the url, you should just put her inside href tag a :

var a = "<a href='" + tag + "' id='link'>Assita o EP via Player Externo</a>";
document.getElementById("wrapper").innerHTML = a;

Browser other questions tagged

You are not signed in. Login or sign up in order to post.