JSFiddle - React, Tailwind, and code Playground

by marcsmith

HTML

<script src="https://github.com/jquery/jquery-tmpl/raw/master/jquery.tmpl.min.js"></script>
<ul id="foo"></ul>
<ul id="foo2"></ul>

CSS

ul {
    float: left;
    width: 100%;
}

JavaScript

var Dude = function(props) {
    this.height = "tall";
};

Dude.prototype.reallyTall = function() {
    //return (this.height || this.data.height) + " as heck";//  THIS WORKS!
    return this.height + " as heck";
};

var guy = new Dude();

jQuery.tmpl("<li>${reallyTall}</li>", guy
).appendTo('#foo');

jQuery("#foo2").append('<li>' + guy.reallyTall() + '</li>');