Last active
August 27, 2015 15:33
-
-
Save normanzb/c12f6c76966bb27d4ed8 to your computer and use it in GitHub Desktop.
This file contains 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
$(function() { | |
var $firstNameField = $("#first_name"); | |
var $target = $(".txt-parabens"); | |
var $message = $("<p class='lead-name' style='text-align: center;'></p>"); | |
$firstNameField.on('change', function() { | |
var inputValue = $firstNameField.val(); | |
if (inputValue == null || inputValue == false) { | |
// hide the text | |
$message.detach(); | |
} | |
else { | |
$message.text(inputValue); | |
$message.appendTo($target); | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment