<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
$( "<input id='myinput' type='text'>" ).appendTo( "body" );
$( "<div id='mytext'></div>" ).appendTo( "body" );
$("#myinput").css({top:0, left: 0,position:'absolute'});
$("#mytext").css({top:50, left: 0,position:'absolute'});
$("#myinput").keyup(function(){
let t = $("#myinput").val();
$("#mytext").text(t);
});
});
</script>
</head>
<body>
</body>
</html>
|