Q:

Add dynamic text (while the user writes) inside label

In a form Im trying to add some dynamic text, while the user writes:
<label for="signup_username">Username</label>
<input type="text" value="" id="signup_username" name="signup_username">

For example if user type "JOSOROMA" then the dynamic text inside label "signup_username" will reflect:
<label for="signup_username">http://www.localhost.lh/josoroma</label>   
<input type="text" value="" id="signup_username" name="signup_username">

If user type "obama" then then the dynamic text inside label "signup_username" will reflect:
<label for="signup_username">http://www.localhost.lh/obama</label>
<input type="text" value="" id="signup_username" name="signup_username"

Thanks in advance.

A:

Something along the lines of :
<label for="signup_username">http://www.localhost.lh/<span></span></label>
<input type="text" value="" id="signup_username" name="signup_username">

<script>
$('#signup_username').keyup(function(e) {
    $(this).prev('label').find('span').html($(this).val());
});
</script>

