Create a gist now

Instantly share code, notes, and snippets.

@helloGoGo /trim.html
Last active Mar 21, 2017

What would you like to do?
<!DOCTYPE html>
<meta charset="utf-8" />
<script src="../library/jquery/jquery-3.1.1.min.js"></script>
* 入力値から前後の空白を削除してフィールドに再セット
$('input').blur(function () {
var value = $(this).val();
<input type="text" name="first_name"/>
<input type="text" name="last_name"/>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment