hhvn.uk

Website, gopher, etc
git clone https://hhvn.uk/hhvn.uk
git clone git://hhvn.uk/hhvn.uk
Log | Files | Refs | Submodules

ytem.html (633B)


      1 Link: <input id="link" type="text" name="id"/>
      2 <input type="button" onclick="embedany()" value="Embed link"/>
      3 
      4 <br /><br />
      5 
      6 Youtube ID: <input id="ytid" type="text" name="id"/>
      7 <input type="button" onclick="embedyt()" value="Embed youtube video by ID"/>
      8 
      9 <br /><br />
     10 
     11 <iframe id="iframe" width="960" height="540" src="//example.com"></iframe>
     12 
     13 <script>
     14 function embedany(){
     15 	document.getElementById("iframe").setAttribute("src", document.getElementById("link").value)
     16 }
     17 function embedyt(){
     18 	document.getElementById("iframe").setAttribute("src", 'https://www.youtube.com/embed/' + document.getElementById("ytid").value)
     19 }
     20 </script>