There is a code, for a long time I thought why it does not work, but it didn’t solve the problem.
function activate(){ var input = document.getElementById('input'); var div = document.getElementById('div'); div.value=input.value; } <div id="id"></div> <input type="text" id="input" /> <button onClick="activate()">
When you click a button, the value from input
should be inserted into the div