function remove_deposit() {
document.getElementById('deposit').checked = false
}
That's all you need. The reason why your code wasn't working was because you used two equals signs, which is a comparison operator, instead of one equals sign, which is the assignment operator.
Addendum: I removed the if statement since it doesn't really do anything useful afaict. If you did this to optimize the code, then I'd just like to point out that checking the if statement will probably be slower than just setting the checkbox to false. Also, you don't need to end every line with a semi-colon in JavaScript. You can do that if you want to put multiple commands on a single line, but otherwise it's not necessary.
Results are in.
If most of the time people running the javascript to set the checkbox to false do have the checkbox set to true, skipping the if statement is faster. Otherwise, if most of the time the checkbox is set to false, then the if statement would be faster. With a 1:1 ratio, no if statement is preferred.
The checkbox would have to be set to false at least 54% of the time for the if code to be more efficient.
http://img33.imageshack.us/img33/4260/results.png http://img33.imageshack.us/img33/4260/results.png
Side-note: If it's a checkbox, it's probably in a form, so you could also access it with the old-fashioned method document.formName.elementName instead of document.getElementById(). Because the form method doesn't need to traverse the DOM like getElementById does, I think that would be faster.
The results are in.
With 0 IDs preceding it, document.test_form.checkbox (DTFC) is slower than document.getElementById('checkbox') (GEBI). With 100 IDs preceding it, document.test_form.checkbox is still slower than document.getElementById('checkbox').
http://img8.imageshack.us/img8/6683/resultsw.png http://img8.imageshack.us/img8/6683/resultsw.png
I guess that settles it.
PS: These were all tested on Firefox using Firebug. I cannot make any claims about the efficiency of Safari's WebKit, Konqueror's KJS, IE's proprietary engine, or Google Chrome's V8. I'm guessing they should wind up somewhat similar to these, but they could be different.