JSFiddle - React, Tailwind, and code Playground

by dmethvin

HTML

a radio: <input type="radio"/>
<button>click me</button>

<div id='results'></div>

JavaScript

//watch radio for change event
$("input").change(function() {
    $("#results").append("<div>change - radio is checked: " + this.checked + " !</div>");
});
$("input").click(function() {
    $("#results").append("<div>click - radio is checked: " + this.checked + " !</div>");
});
//on button click, trigger a click of the radio,
//which should then trigger change.
//BUG: the radio checked BEFORE firing in chrome
//                   and AFTER firing in IE 7/8
$("button").click(function() {
   $("input")[0].click();
});