Simple JS button+prompt
Add text to textarea via JS prompt
by Matt Reynolds
HTML
<input type="button" value="click me" id="clickButt" />
<input type="textarea" placeholder="your text goes here" id="output" />
<input type="button" value="Reset" id="reset" />
CSS
#clickButt{
height: 40px;
width: 80px;
background-color: rgba(0, 255, 255, 0.1);
border: 0px solid rgba(127, 127, 127, 0.2);
-webkit-appearance: none;
-moz -appearance: none;
font-family: Helvetica;
font-size: 12px;
}
#output{
height: 40px;
border: 0px;
padding: 0 0 0 15px;
font-family: Monospace;
}
#reset{
height: 40px;
border: 0px;
-webkit-appearance: none;
-moz -appearance: none;
background-color: rgba(25, 25, 25, 0.2);
}
JavaScript
document.getElementById("clickButt").onclick = function(){
var result = prompt("Enter Your Text");
document.getElementById("output").value = result;
};
document.getElementById("reset").onclick = function(){
document.getElementById("output").value = "";
};