JSFiddle - React, Tailwind, and code Playground

by eterps

HTML

<script src="http://hafriedlander.github.com/jquery.entwine/js/jquery.entwine-dist.js"></script>
<div class="internal_text">Internal text</div>
<div class="attribute_text" rel="Attribute text"></div>
<div>Nonsense</div>

<button>Call foo()</button>

JavaScript

$('.internal_text').entwine({
    foo: function(){
        $('body').append('<p>' + this.text() + '</p>');
    }
});
$('.attribute_text').entwine({
    foo: function(){
        $('body').append('<p>' + this.attr('rel') + '</p>');
    }
});


$('button').click(function(){
    $('div').foo();
});