I have some AJAX, it pulls in the following, which is added to a div
using innerHTML
.
<a href="#" onclick="javascript:document.getElementById('textareax').value += '\r\nTEST';">Add</a>
Then when I press the "Add" link, it will add "TEST" into textareax
.
If I have it in the HTML of the document from the start, it works perfectly, but when I pull it in using AJAX and using innerHTML
to add it to the div
the "Add" link does not work.
I think it might be a problem because it has javascript in it and I am just adding it using innerHTML
, but don't know how to solve this.