Can anyone tell me how do you clone from a span element and append to input value by clicking the span element itself? Here is the script.
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script>
$(document).ready(function() {
$("span#username").click(function() {
$("span#username").clone().appendTo("#test");
});
});
</script>
</head>
<body>
<span id="username"> User </span><br><br>
<input type="text" id="test" value="" />
</body>
</html>