I have a function(it adds text to a text area), it works the first time I load a page, and then keeps working if I keep using it, but if I edit the text myself, it no longer works, or if I have text in the box and refresh the page, it doesn't work.
Code:
function reply(id) {
document.getElementById("replytext").innerHTML = "@post-" + id + "\n" + document.getElementById("replytext").innerHTML;
}
EDIT: figured it out. realized that there's a difference between the innerhtml of a textarea and the value of it. using value instead gets the contents.
Last edited by Skeddles; 02-05-2011 at 06:29 PM..
|