JSFiddle - React, Tailwind, and code Playground

by Rich Costello

HTML

<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.4/themes/ui-lightness/jquery-ui.css">
<div class="news-story">
 <h5 class="test"></h5>
 <p></p>
 <h5></h5>
 <p></p>
</div>

JavaScript

var div = document.getElementsByClassName('news-story')[0],
    h5 = div.getElementsByClassName('test'),
    p = div.getElementsByTagName('p'),
    data = {
        "items": [
            {
            "title": "sample 1",
            "author": "author 1"},
        {
            "title": "sample 2",
            "author": "author 2"}
        ]
    };


data.items.forEach(function(v, i) {
    h5[i].innerHTML = v.title;
    p[i].innerHTML = "By: " + v.author;
});