I have created a HTML document with following code..
<html>
<head>
<title>My Page</title>
</head>
<body>
<textarea id="main">
Hi this is sample content
</textarea>
</body>
</html>
My problem is that I am not able to update the content of the textarea using javascript.
I am using Firefox 3.6 on Ubuntu
Now I am using a Firefox addon for this and I have added this code to the overlay.js file
window.content.document.getElementById("main").innerHTML += "some content";
As none of the code is working and i need to change the content of the textarea in any possible way.
Have you tried to look at the Error Console? My guess is that the browser didn’t find the textarea because the script is above it. Try putting the script below the textarea declaration or put the code in a function and call it on body onload event.