JSFiddle - React, Tailwind, and code Playground

by glenswift

HTML

<h1>Hello World Text!</h1>

JavaScript

//RESIZE OUTPUT WINDOW ----->

function setPositions(){
    var W = $(window).width(),
        h1 = '';
    if (W < 210) {
        h1 = 'Hello';
    } else if (W < 270) {
        h1 = 'Hello World';
    } else {
        h1 = 'Hello World Text'
    }
    $('h1').empty().text(h1);
}
$(document).ready(function(){
    setPositions();
});
$(window).resize(function(){
    setPositions();
});