Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $('#button').on('click', function() {
- var comment = $('.message-box').val();
- var prefix = "Thank you, "
- var suffix = ". We have received your message!"
- var name = $('.text-box1').val();
- $('#visible-comment').html(prefix+name+suffix);
- if (comment === "") {
- $("#message-box").css("border", "2px solid red");
- } else {
- $('.text-box1').hide();
- $('.text-box2').hide();
- $('.phone-box').hide();
- $('.email-box').hide();
- $('.message-box').hide();
- }
- return false;
- });
Add Comment
Please, Sign In to add comment