JSFiddle - React, Tailwind, and code Playground
by mowglisanu
HTML
<div class="content">
<input type="checkbox" name="checkbox" />
<textarea name="textarea">Old Text</textarea>
<input type="text" name="input" value="Old Value" />
<select name="select"><option value="0">Select</option><option value="1">One</option></select>
<input type="button" class="send" value="Send" />
</div>
JavaScript
jQuery(document).ready(function($) {
$('.send').click(function() {
var input = $('input[type=text]'),
checkbox = $('input[type=checkbox]'),
text = $('textarea'),
select = $('select');
input.attr('value', input.val());
checkbox.attr('checked', checkbox.prop('checked'));
text.html(text.val());
select.find(':selected').attr('selected', 'selected');
alert( $('.content').html() );
return false;
});
});