Created
March 23, 2020 07:41
-
-
Save seathief/147efec9c254ebbc9074e6e1c3ad1cbb to your computer and use it in GitHub Desktop.
html input value sync
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# html | |
<input type="text" class="form-control" id="appName1" | |
data-sync="input" data-target="#appName2"> | |
# javascript | |
$("[data-sync='input']").blur(function(){ | |
$($(this).data('target')).val($(this).val()); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment