JSFiddle - React, Tailwind, and code Playground

by tvdavid

HTML

<div id="episode-template">
    <a class="show"></a>: <a class="episode"></a> (<span class="se"></span>)
</div>

<ul id="tvm-schedule"></ul>

CSS

#episode-template { display: none; }

JavaScript

$.get('http://api.tvmaze.com/schedule?country=US', function(data) {
    $.each(data, function(i, episode) {
        var $html = $('#episode-template').clone();
        
        $('.episode', $html).html(episode.name);
        $('.episode', $html).attr('href', episode.url);
        
        $('.show', $html).html(episode.show.name);
        $('.show', $html).attr('href', episode.show.url);
        
        $('.se', $html).html(episode.season + 'x' + episode.number)
        
        $('#tvm-schedule').append('<li>' + $html.html() + '</li>');
    });
});