Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Get span id

Status
Not open for further replies.

guitardave78

Programmer
Sep 5, 2001
1,294
GB
Hi, how do i test for the id of a span element when it is clicked on?

i have code that on right mouse click does a copyright script, but i want to be able to exclude a particluar span id
 
Code:
<span id=&quot;mySpan&quot; onClick=&quot;alert(this.id)&quot;>Some Text</span>
 
is there a way do do it with out a click event on the span so in a function it can actually check to see if the span id is ignore or somthing?
 
the reason being that the span content is an href so i need it to work on right click
 
i used the onmousedown and set a variable in a function that overides the copyright script!
onmousedown=&quot;id_get()&quot;

thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top