title: How to retrieve string value from a json using javascript?
body: <p>My site stores strings in a json file and uses javascript to retrive value to HTML. Here's simplified version of the function.</p>
  
  <p>HTML:</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
      &lt;script src="script.js"&gt;&lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
    This is a demonstration. The author is:
      &lt;div&gt;
        &lt;div class="author"&gt;&lt;/div&gt;
      &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Javascript:</p>
  
  <pre><code>request = new XMLHttpRequest();
  request.open('GET', 'data.json', true);
  
  request.onload = function () {
     obj = JSON.parse(request.responseText);
     obj.forEach(function (d) {
          var el = document.createElement('p');
          el.textContent = d.author;
          document.getElementsByClassName('author')[0].appendChild(el);
      });
  };
  
  request.send();
  </code></pre>
  
  <p>Json:</p>
  
  <pre><code>{
    "author": "John Doe"
  }
  </code></pre>
  
  <p>Implementation: <a href="http://embed.plnkr.co/Ixrz9R2KVLXpOqa7mwyU" rel="nofollow noreferrer">http://embed.plnkr.co/Ixrz9R2KVLXpOqa7mwyU</a></p>
  
  <p>The code doesn't return author name in the HTML. Is there anyway to do this without using jQuery if possible.</p>