IT Community - Software Programming, Web Development and Technical Support

Identifiying the type of elements in a web page

This is a discussion on Identifiying the type of elements in a web page within the HTML, CSS and Javascript Coding Techniques forums, part of the Web Development category; Hi can any one tell me how to identify the type of an element in the web page during the ...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Web Development > HTML, CSS and Javascript Coding Techniques

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 08-14-2007, 07:01 AM
seesamjagan seesamjagan is offline
D-Web Programmer
 
Join Date: Aug 2007
Location: Chennai
Posts: 66
seesamjagan is on a distinguished road
Send a message via AIM to seesamjagan Send a message via Yahoo to seesamjagan
Question Identifiying the type of elements in a web page

Hi

can any one tell me how to identify the type of an element in the web page during the rollover event...?

ie., i need to display a message saying that, "mouse is on the 'xxx' element

the xxx may be a div, h1, a, p or what ever it is
__________________
SeeSamJagan
- Sky is not the "LIMIT", Death is not the END, There is still something beyond....
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 08-14-2007, 07:30 AM
a.deeban a.deeban is offline
D-Web Analyst
 
Join Date: May 2007
Posts: 279
a.deeban is on a distinguished road
Default Re: Identifiying the typeOf elements on the page

Hi,

we can find the element in mouse over using javascript, we have to call a function on BODY's mouseover event.

here is the simple example for your need.


<HTML>
<HEAD>
<SCRIPT language="javascript">
function whichelement(elem) {
var x = event.clientX
var y = event.clientY
if (window.event.srcElement.name)
status = window.event.srcElement.name;
else
status = "";
}
</SCRIPT>
</HEAD>
<BODY onmouseover="whichelement()">
<form>
<textarea name="TextArea" wrap="off" cols=12 rows=4>
This is line 1
This is line 2
This is line 3
</textarea>
<br>
<input type="text" name="Text1" value="mytextvalue">
<br>
<input type="text" name="Text2" value="othertextvalue">
</form>
</BODY>
</HTML>

i hope this will help you....

thnx...
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 08-16-2007, 12:46 AM
seesamjagan seesamjagan is offline
D-Web Programmer
 
Join Date: Aug 2007
Location: Chennai
Posts: 66
seesamjagan is on a distinguished road
Send a message via AIM to seesamjagan Send a message via Yahoo to seesamjagan
Thumbs up Re: Identifiying the typeOf elements on the page

Hi,

Thanks for your reply, its working fine!
__________________
SeeSamJagan
- Sky is not the "LIMIT", Death is not the END, There is still something beyond....
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 08-16-2007, 12:51 AM
seesamjagan seesamjagan is offline
D-Web Programmer
 
Join Date: Aug 2007
Location: Chennai
Posts: 66
seesamjagan is on a distinguished road
Send a message via AIM to seesamjagan Send a message via Yahoo to seesamjagan
Question Re: Identifiying the typeOf elements on the page

Hi,

Its working fine in IE but not in FireFox...?
What is the problem in the code ,
Which attribute is not supporting in FF!
__________________
SeeSamJagan
- Sky is not the "LIMIT", Death is not the END, There is still something beyond....
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how can i set content type in jsp page.? saravanan Java Server Pages (JSP) 3 09-21-2008 09:25 AM
call xml elements in php Vani Sri PHP Programming 11 03-11-2008 06:29 AM
'Page' ia an unambiguous reference between 'System.Web.UI.Page' and 'Project1.Page' poornima ASP and ASP.NET Programming 1 03-05-2008 03:12 AM
What is Value type and reference type in .Net? anbuchezhians VB.NET Programming 2 08-21-2007 10:42 PM
ASP with paging elements kingmaker HTML, CSS and Javascript Coding Techniques 1 07-19-2007 12:32 AM


All times are GMT -7. The time now is 11:01 AM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0