I am trying to set up a download page feature on my WordPress blog. I need to extract an HTML element with the id="download" from any URL that directed to the download page.
Can someone help me with this task? I've included the code below, but unfortunately, it is not functioning as expected.
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"> </script>
<script type="text/javascript">
var pagereferrer = Document.referrer;
var timeleft = 10;
var downloadTimer = setInterval(function(){
timeleft--;
document.getElementById("countdowntimer").textContent = timeleft;
if(timeleft <= 0)
clearInterval(downloadTimer);
},1000);
$( "#div1" ).load(pagereferrer #download);
</script>
<h2>
<span style="font-family: 'comic sans ms', sans-serif;">
<strong>Please wait! Your download will begin in <span id="countdowntimer">10 </span> Seconds.......</strong>
</span>
</h2>
<div id="div1"> </div>