html代码
<input type="text" id="test" name="test" class="input-xs " />
js代码
$(".input-xs:text").each(function () {
jQuery(this).change(function () {
jQuery(this).val(jQuery.trim(jQuery(this).val()));
})
})