<!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='mytext' type='input' value='mytext'>" ).appendTo( "body" );
$( "<input id='myclick' type='button' value='++'>" ).appendTo( "body" );
$("#mytext").css({top:0, left: 0,position:'absolute'});
$("#myclick").css({top:50, left: 0,position:'absolute'});
$("#myclick").click(function(){
let mtext = $("#mytext").val();
$("#mytext").hide();
$("#myclick").hide();
$( "<div id='hello'></div>" ).appendTo( "body" );
$("#hello").text(mtext);
$("#hello").css({'font-size':Math.random()*100+50});
let timerId = setInterval(function () {
$("#hello").text(mtext);
$("#hello").css({'font-size':Math.random()*100+50});
}, 1000);
});
});
</script>
</head>
<body>
</body>
</html>
|