Well I'm pretty sure the id was tb but I'll double check that. Also the javascript runs on a button click so the page is fully loaded once it runs.
Printable View
Well I'm pretty sure the id was tb but I'll double check that. Also the javascript runs on a button click so the page is fully loaded once it runs.
One way of debugging your code is as follows:
Code:try {
<<Your code goes here>>
} catch (err) {
alert(err);
}
What happens after? That is, what is *meant* to happen after that? As Flash says, one way to test things is to litter your code with alert(val) during testing - so in this case you could add a line after that that just saysCode:var tbox = document.getElementById("tb").value;
which will let you know if anything is being stored in tbox. If you posted up the rest of the code we might be able to spot something in it - it's very hard to bug fix from one line!Code:alert(tbox);