title: Dynamically adding a video element using jQuery
body: <p>EDIT: People have correctly pointed out I was using the wrong type for the video files I was using before. I now realize that if I want to use youtube videos I need to use the iframe tag</p>
  
  <p>I'm having trouble creating the source tag and appending it inside the video tag. Right now my src is being added inside the video tag like this </p>
  
  <pre><code>src= "[object Object]"
  </code></pre>
  
  <p>I'm loading my data from a json array. I'm also loading some other data from my json array which you will see in the code below.
  My jQuery</p>
  
  <pre><code>function postContent(data) {
    var $h2 = $("&lt;h2&gt;");
    var $div = $("&lt;div&gt;");
  
    $h2.html(data.title);
    $div.addClass("imgPlaceholder " + data.color);
  
    var $h3 = $("&lt;h3&gt;");
    var $src = $("&lt;src&gt;");
  
    $h3.html(data.videoTitle);
    $src.html(data.videoSrc);
    alert($src);
    var video = $('&lt;iframe /&gt;', {
        id: 'video',
        src: data.videoSrc,
        //type: 'video/mp4', This was needed when I used the video tag
        //controls: true
      });
  
      //$src.appendTo($('#video')); This broke the page 
  
      $("#display")
          .append($h2)
          .append($div)
          .append($h3);
  
          video.appendTo($('#display'));
  </code></pre>
  
  <p>Here is my html</p>
  
  <pre><code>&lt;div id="wrapper" class="group"&gt;
      &lt;h1&gt;&lt;/h1&gt;
      &lt;hr&gt;
      &lt;ul id="menu"&gt;&lt;/ul&gt;
      &lt;div id="display"&gt;&lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Here is my json array EDIT: changed src to youtube videos</p>
  
  <pre><code>{
  "appTitle": "Content Navigator",
  "posts": [
  {
    "id": 1,
    "title": "Content 1",
    "videoTitle": "Video Title 1",
    "color": "orange",
    "videoSrc": "https://www.youtube.com/watch?v=nRSYU4YSISA",
  },
  {
    "id": 2,
    "title": "Content 2",
    "videoTitle": "Video Title 2",
    "color": "purple",
    "videoSrc": "https://www.youtube.com/watch?v=WijDExREruo",
  },
  </code></pre>