Ver vĂdeo
//JavaScript code used to redirect a user to the requested newstea page.
//The id of the page has already been included in the URL.
// The code slices out the ID from the URL and redirects accordingly
/*
moneytag links:
https://otieu.com/4/7865199
https://otieu.com/4/7870055
https://otieu.com/4/9145479
https://otieu.com/4/9145478
https://otieu.com/4/8772462
https://otieu.com/4/8772464
*/
var inboundURL = window.location.href;
var item1 = inboundURL.split(".html");
var item2 = item1[1]; //pick the requested id
var selectID = document.querySelector(item2).href;
var clickMeButton = document.querySelector("#display");
clickMeButton.href = selectID;
alert (clickMeButton.href);