Dropsen Dropsen - 9 months ago 47
jQuery Question

Printing message after typing in form input

everyone. I really want to know how to do effect similar to this:


I mean, I want to change for example: 'First Name' to 'Hello, (and typed text in the input after changing input type. If you know how to do similar effect for example in jQuery or other plugins tell me, please! I know how to print typed text in the input, but it isn't what I want to do, because I want to show full text: 'Hello, (typed msg) after using tab or changing input field.
I appreciate every kind of help.



<div class="form-group">
    <label id="label-name" for="name">First Name</label>
    <input class="form-control" type="text" id="name" placeholder="Enter your name" />


$('#name').on('change', function() {
    var val = $('#name').val();
      $('#label-name').html('Hi ' + val);   
      $('#label-name').html('First Name');

Fiddle: https://jsfiddle.net/on142Lvp/