What i want to illustrate, is what i want. The text transforms into an input field when the user clicks on it. But it will be the best if the cursor will be there on click. How to earn it?
const input = () => {
const field = document.querySelector('input');
document.querySelector('p').style.display = 'none';
field.style.display = 'block'
}
input{
display: none
}
<p id='target' onClick='input()'>Click</p>
<input
type='text'
value='type'
name='name'
/>