JSFiddle - React, Tailwind, and code Playground
by webvitaly
HTML
<link rel="stylesheet" href="http://twitter.github.com/bootstrap/assets/css/bootstrap.css">
<div class="well">
<span class="click">get value</span>
<input type="text" value="input value">
<span class="old-value"></span>
</div>
CSS
.click {
border-bottom: 1px dashed #555;
cursor: pointer;
}
JavaScript
$(function(){
$('.old-value').text( $('input').val() ); // get the input value
$('input').val('changed input value'); // set the input value
$('.click').click(function() {
$('.old-value').text( $('input').val() );
});
});