How to make a link?

<div id="div-name"></div> <!-- displays DDT - the Last autumn -->
<?php
$s = file_get_contents("http://данные from the server received for this url");
?>
the <script>
var myDiv= document.getElementById("div-name"), 
json = '<?php echo $s;?>',
data = JSON.parse( json );
myDiv.innerHTML = data.icestats.source.title;
</script>

In div-name displays the text - the author and the title of the song. Want to make a link and substitute the data element name in this link.
Link looks like this
https://vk.com/search?c%5Bq%5D=Мумий%20Троль%20-%20дельфины&c%5Bsection%5D=auto

How to enter this link in the div and expose the name of the track in that link?
figuratively and bluntly saying
<a href="https://vk.com/search?c%5Bq%5D=<div 
id=" div-name">&c%5Bsection%5D=au
to"><div id="div-name"></div></a>
June 8th 19 at 17:00
1 answer
June 8th 19 at 17:02
You have some strange approach. In PHP variable you have JSON and you can parse by PHP and paste directly without javaScript. You will avoid the need JS and any ekranirovanii JSON. Do everything in PHP, then create links to it will be much easier.
Yes? I would be grateful if you tell as. - Nedra3 commented on June 8th 19 at 17:05

Find more questions by tags JavaScriptPHP