Links

Lists

Latest Updates

Ruby On Rails List
Python list
Advanced Java
The JavaScript List
Apache Users
Full Disclosure
Linux Security

Search the archives!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Javascript] Problem w/Javascript, interpolation, functions, onclick


  • From: mwarden at gmail.com (Matt Warden)
  • Subject: [Javascript] Problem w/Javascript, interpolation, functions, onclick
  • Date: Wed Oct 25 10:51:13 2006

On 10/25/06, Nathan V. Patwardhan <nvp@xxxxxxxxx> wrote:
>     <span id="addthis" onclick="function1(this)">Add This</span>
>     <span id="cancel" onclick="function2(this)">Cancel</span>
>   </td>
>
> I pass 'this' to a function -- since 'this' represents the current span
> that was selected.  My code finds the last (third) cell in the current
> row (of 'this'), and modifies contents of the same table row to reflect
> which of the spans was selected.

I am not sure whether onclick will fire on spans in all browsers. But,
assuming it will, try this instead of passing 'this':

http://mwarden.f2o.org/sandbox/getidfromeventhandler.js




-- 
Matt Warden
Cleveland, OH, USA
http://mattwarden.com


This email proudly and graciously contributes to entropy.