JSFiddle - React, Tailwind, and code Playground
by shahrukh007
HTML
<html>
<head>
<form>
<input name='name' type = 'text' id='name'/>
<input name='email' type = 'text' id ='email'readonly/>
<button id='btn' onclick='myfunction(event)'>click me!</button>
<script>
function myfunction(e){
e.preventDefault(e);
var x= $('#name').val()
$('#name').val('')
$('#email').val(x.trim())
}
</script>
</form>
</head>
</html>