JSFiddle - React, Tailwind, and code Playground

by Luke Marlow

HTML

<button class="btn">Test [Div]</button>
<button class="btn2">Test [Console]</button>
<div class="output"></div>

JavaScript

$('.btn').click(function(e) {
    e.preventDefault();
    
    var data = [
    	'As somebody requested this, ', 
    	'in the comments on stack overflow,', 
    	'here is a quick fiddle.',
     	'Call the news, a fiddle with no kids involved!'
    ],
    output = '';

	for (var property in data) {
    	output += property + ': ' + data[property]+'; ';
	}

	$('.output').html(output);
});
$('.btn2').click(function(e) {
    e.preventDefault();
    
    var data = [
    	'As somebody requested this, ', 
    	'in the comments on stack overflow,', 
    	'here is a quick fiddle.',
     	'Call the news, a fiddle with no kids involved!'
    ];
    
	for (var property in data) {
    	console.log(data[property]);
    }

});