I’m trying to add things to a textarea. it’s not working…
<html><head></head><body>
<div id="wrapper">
<div id="leftc">
text here
<a href="#" onclick="javascript: $('wrapper').$('rightx').$('thebox').value += 'TEST\ntest\n\ntest">Add</a>
</div>
<div id="rightx">
<textarea id="thebox" rows="10" cols="50"></textarea>
</div>
</div>
</body></html>
Any ideas?
EDIT: SOLUTION I USED: (Thank you all for insight into my errors)
<a href="#" onclick="javascript:document.getElementById('thebox').value += 'TEST\ntest\n\ntest';">Add</a>
This piece of code makes no sense and is full of errors:
The proper jQuery code would be:
Or, this might even be more straightforward in plain javascript:
You had the following errors: