Alan Alan - 1 month ago 6
Javascript Question

Take the contents from textbox in first div and then display it in Second div in label format?

I have to take the contents from textbox in first div and then display it in Second div in label format, what should I do ?

Answer

html

<div id="myText">myText</div>
<div id="myLable"></div>

js

var textField = document.getElementById('myText');
var lableField = document.getElementById('myLable');
lableField.innerText = textField.value;
Comments