The Motley Fool Discussion Boards

Previous Page

Computers, Phones & Internet / Webmaster's Corner

URL:  http://boards.fool.com/denny-said-add-an-alert-to-find-out-yep-i-did-30179554.aspx

Subject:  Re: HTML / Javascript question Date:  7/31/2012  9:54 PM
Author:  DoLoop Number:  16319 of 16451

Denny said: Add an alert to find out:

Yep - I did that. In fact I went even further. I added two other alerts to display the element's id and it's name, like so:

function setFocus(fldID) {

alert(fldID);
alert('id:'+document.getElementById(fldID).id);
alert('name:'+document.getElementById(fldID).name;
document.getElementById[fldID].focus();

}

All three alerts show the correct value! And yet, the .focus statement still generates the error.

I've been fussing around with this for several hours now and simply cannot figure it out. :(

And, BTW, I ran the page through the W3C page validation service - it shows no errors. Any other suggestions will be greatly appreciated.
Copyright 1996-2014 trademark and the "Fool" logo is a trademark of The Motley Fool, Inc. Contact Us