# Saturday, December 18, 2004
« Skipping over a routine automatically in... | Main | Implementing the Split function in C# »

One of the things I use this blog for is to keep track of tips which I may need while out at the client site. I have a fairly extensive CodeLib library I use, but for some reason, I didn't have this in my library.

If you're new to javascript, which I am definitely still in the learning stages of, at some point you are going to access the control which called a function. I did a few searches, and it turns out, unless you know what you are looking for, it's tough to do a search like “javascript determining control which called a function” and similar searches. So here goes, and hopefully this simple tip will save another developer a little time. It IS a basic function, I will be the first to admit, but it is also useful to know for an ASP.Net developer. And the code is:

document.activeElement

There you go! Simple, but for some reason, it's assumed you should know it, which to a degree, I agree with. But I would also have to say online there seems to be an assumption that everyone already knows the DOM!