105
rated 0 times
[
112]
[
7]
/ answers: 1 / hits: 29128
/ 12 Years ago, sat, january 5, 2013, 12:00:00
document.getElementById('area').onkeyup=keydown;
function keydown (event) {
if (event.target.id=='area' && event.which==13) {
document.getElementById('arsh').innerHTML+=n;
}
}
Arsh is the ID of my paragraph where i want to add the new line why is this not working can anyone help me ?I just want to add a new line when Enter is pressed in the textarea (ID area) to my Paragraph (ID arsh).
here is the HTML
<textarea ID=area class=in>
Message
</textarea>
<br />
<br />
<p ID=tiesh class=sh>
</p>
<br />
<br />
<p ID=arsh class=sh>
</p>
<br />
</div>
I am basically trying to do it like here in stackoverflow when you press enter in the textarea down the paragraph jumps down a line also.
More From » html