I found this code that works great on inputs:
<script>
$(function() {
$("[name='email']").keyup(function() {
var email = $(this).val();
$("[name='login']").val(email); }); });
</script>
<input type="text" name="email" placeholder='email' />
<input type="text" name="login" placeholder='login' />
But I made some modifications that wanted to make it work on other elements such as span.
<script>
$(function() {
$("[name='email']").keyup(function() {
var email = $(this).val();
$(email).insertAfter("span.login"); }); });
</script>
<input type="text" name="email" placeholder='email' />
<span class="login"></span>
But it does not work, but if I put any text ready in place of $ (email) .insertAfter it works, is there a way to work as it works in input?