Got a little code here:
function clear(fields) {
elms=fields.split(',');
for(i=0;i<elms.length;i++) {
$(elms[i]).innerHTML = '';
}
it's to clear the output of a calculator I'm working on. Used in conjunction with this.form.reset() I can clear the entire "calculator table". It basically needs to empty a couple table cells which would be filled with the calculator's output.
So, I'm calling it like this:
<input type="button" ....... onclick="clear('pipm,prpm')" />
The argument in the single quotes is the ids of the elements I want to empty, the table cells that is. Here's the weird thing - it works when called from the URL line or JS console, but NOT when the "Clear" button is clicked.
Why isn't this working? Been bugging me all night. The rest of my functions work like a charm but not this guy.
Thanks again!