JSFiddle - React, Tailwind, and code Playground

by Krishna Gopinath

HTML

<div data-role="page" id="mypage">
    <div data-role="header" data-theme="a">
         <h1> Online Voting</h1>

    </div>
    <div data-role="content">
        <div>Click on a song to vote for it!</div>
        <ul data-role="listview" id="songlist" data-theme="c" data-divider-theme="a" data-inset="true">
            <li data-role="list-divider" role="heading">Song List</li>
        </ul>
        <div></div>

JavaScript

var songs = ["Sweet Child 'O Mine", "Summer of '69", "Smoke in the Water", "Enter Sandman", "I thought I've seen everything"];

$.each(songs, function (i, song) {
    $("<li/>", {
        "data-icon": "star",
            "class": "vote",
            "html": '<a href="#" id="song' + i + '">' + song + '</a>',
            "id": i
    }).appendTo("#songlist");
});