Skip to content

Instantly share code, notes, and snippets.

@jimjamdev
Last active August 29, 2015 14:27
Show Gist options
  • Save jimjamdev/f1acd841c2476d3a1807 to your computer and use it in GitHub Desktop.
Save jimjamdev/f1acd841c2476d3a1807 to your computer and use it in GitHub Desktop.
function printInputValue(input, output, symbol) {
function updateOutput() {
$(output).html(input.val() + symbol);
}
$(input).on("input change", function() {
updateOutput();
});
updateOutput();
}
// Call via this function
//<script>
//printInputValue($('#input_field'), $('#output_div'), '%');
//</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment