473,486 Members | 2,114 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How can get the id of the focused element of the web page

1 New Member
I want to take the id of the focused element in the page by javascript.
but with my situation i cant use the onFouse() method of each element to call other javascript element.

simply without changing the body of the page i want to get the id of focused element.

how can i do it?
plz help me all the experts soon!!!!!
Jul 1 '08 #1
1 3740
rnd me
427 Recognized Expert Contributor
it is a property of document:
Expand|Select|Wrap|Line Numbers
  1.    alert(document.activeElement)
  2.  
check out MDC for more info.

this used to be IE only, until firefox 3 picked it up. so, it won't work in FF2 and perhaps other browsers
Jul 1 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
10076
by: Gilles Lenfant | last post by:
Hi, I got an element ( say <div id="foo">... ) at its natural position in a page. I need to get the distance (in pixels) between the top of that element and the top of the page/frame. Of...
22
10325
by: DJ WIce | last post by:
Hi, I'm looking for a script to get the hi-est z-index on a page. I want my javascript menu to be always on top of the page (moves along on top when you scroll down). Does anyone know how to...
1
2523
by: J. Potts | last post by:
Just out of curiosity, has anyone run into this problem? Someone where I work put a set of pages together with the following in the style sheet: BODY { position: absolute; margin-top: 0mm;...
21
3924
by: Michael Bierman | last post by:
Please forgive the simplicy of this question. I have the following code which attempts to determine the color of some text and set other text to match that color. It works fine in Firefox, but does...
1
1547
by: Michael A. Covington | last post by:
Why is it that, if there is a combo box on the main form, it gets the focus initially, regardless of which other element we have set the focus to?
3
1593
by: Boni | last post by:
Dear all, if I have a Form and some controls on it, how can I get a pointer to the focused control. I what to remember focused control, do some operations and then restore focus
27
4578
by: one man army | last post by:
Hi All- I am new to PHP. I found FAQTS and the php manual. I am trying this sequence, but getting 'no zip string found:'... PHP Version 4.4.0 $doc = new DomDocument; $res =...
0
857
by: Gilgul | last post by:
Hi i am trying to find the handle of the current focused control in all the running application. I tried GETFOCUS() but it gave the the handle only of the current thread There are 2 options of...
0
7100
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6964
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
6842
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5434
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4559
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3070
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3070
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
598
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
262
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.