title: is it possible to play a tiktok in an iframe or div?
body: <p>I am creating an array of objects corresponding for a different tiktok urls and ids i would like to reference and play when I call upon a given function.</p>
  <p>I can't get the video to play though.</p>
      
  <p>by itself will show the working video but I'm having difficulty interchanging the url and id to play different videos tied to an onclick to a button</p>
  <p>below is what I have and not sure if there is an issue with my document.getElementById(&quot;visualDrinkMaker&quot;).src = ...</p>
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang=&quot;en-us&quot;&gt;
    &lt;head&gt;
      &lt;meta charset=&quot;UTF-8&quot;&gt;
      &lt;title&gt;tiktok&lt;/title&gt;
    &lt;/head&gt;
    &lt;body&gt;
      
      &lt;iframe id=&quot;drinkMaker&quot; width=&quot;520&quot; height=&quot;360&quot;  frameborder=&quot;0&quot; &gt;&lt;/iframe&gt;
  
      &lt;div id=&quot;visualDrinkMaker&quot;&gt;  
  
      &lt;/div&gt;
      &lt;button id=&quot;coffee&quot;&gt;coffee&lt;/button&gt;
      &lt;script type=&quot;text/javascript&quot;&gt;
  
       const drinksList = [
          coffee = {url: &quot;https://www.tiktok.com/@traderjoesfoodreviews/video/6822687886077332741&quot;,
                  id: &quot;6822687886077332741&quot;},
          latte = {url: &quot;https://www.tiktok.com/@starseed137/video/6846913513248574725&quot;,
                  id: &quot;6846913513248574725&quot;}
        ]
      document.getElementById(&quot;coffee&quot;).onclick =myFunction()
  
      function myFunction() {
        let url = drinksList[0].url;
        let id = drinksList[0].id;
       document.getElementById(&quot;visualDrinkMaker&quot;).src = '&lt;blockquote class=&quot;tiktok-embed&quot; cite=' + url + ' 
       data-video-id=' + id + ' style=&quot;max-width: 605px;min-width: 325px;&quot; &gt; &lt;section&gt; &lt;/section&gt; 
       &lt;/blockquote&gt; &lt;script async src=&quot;https://www.tiktok.com/embed.js&quot;&gt;';
      }
     &lt;/script&gt;;
  
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>