I have a media URL in each page from my database. I play the media with JavaScript code and I have to include it in my page so the JS cat get the media URL and play it.
Is it OK to include the URL in a <span>
tag and hide it with CSS or is that likely to get my site penalized by search engines for hidden text? Should I include this URL in another way?
Example:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<span id="urlishere" style="display: none;"><? echo $urlfromdatabase; ?></span>
<script>
linkmusic = document.getElementById("urlishere").innerHTML;
music = new Audio(linkmusic);
music.play();
</script>
<!-- I want to know if Google has any problem with this hidden URL on the page? -->
</body>
</html>