Skip to content

Instantly share code, notes, and snippets.

@ohcibi
Created January 15, 2013 08:40
Show Gist options
  • Save ohcibi/4537261 to your computer and use it in GitHub Desktop.
Save ohcibi/4537261 to your computer and use it in GitHub Desktop.
<!doctype html>
<html>
<head>
<title></title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(function() {
one = $('#one');
one.val('-');
one.val(one.val() + '2');
two = $('#two');
two.val('2');
two.val('-' + two.val());
});
</script>
</head>
<body>
<input type="number" id="one">
<input type="number" id="two">
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment