Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Tree: 28da36a518
Fetching contributors…

Cannot retrieve contributors at this time

68 lines (62 sloc) 2.35 KB
<!doctype html>
<html lang="en">
<meta charset="utf-8">
<title>Checked Demo</title>
<style type="text/css">
#messages { height: 100px; overflow: auto; display: block; width: 99%; }
.color-default { color: black }
.color-alt { color: white }
.bg-default { background-color: yellow }
.bg-alt { background-color: blue }
.bg-default { border: solid 3px red; }
.bg-alt { border: solid 3px green; }
<textarea id="messages" class="color-default bg-default border-default" placeholder="Modify A Control" disabled></textarea>
<legend>Text Inputs</legend>
<input id="input" class="target" type="text" placeholder="Inputs..." />
<textarea id="textarea" class="target" placeholder="Textareas..."></textarea>
<legend>Checkable Inputs</legend>
<label for="checkboxA">Checkbox Inputs:</label>
<input id="checkboxA" class="target" name="checkbox" type="checkbox" value="checkboxA" />
<input id="checkboxB" class="target" name="checkbox" type="checkbox" value="checkboxB" />
<label for="radioA">Radio Inputs:</label>
<input id="radioA" class="target" name="radio" type="radio" value="radio A" />
<input id="radioB" class="target" name="radio" type="radio" value="radio B" />
<legend>Selectable Inputs</legend>
<select id="select" class="target">
<option value="">Select Boxes</option>
<option value="Option A">Option A</option>
<option value="Option B">Option B</option>
<option value="Option C">Option C</option>
<script src=""></script>
<script src="jquery.changed.js"></script>
var message;
function onDomReady() {
var targets = jQuery('.target');
message = jQuery('#messages');
targets.bind('changed', changeText);
targets.bind('changed', 'color', toggleClass);
targets.changed('bg', toggleClass);
$(document.body).delegate('.target', 'changed', 'border', toggleClass)
function toggleClass(event) {
function changeText(event, value) {
message.text( + ' => ' + JSON.stringify(value) + '\n' + message.text());
Jump to Line
Something went wrong with that request. Please try again.