469,276 Members | 2,057 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,276 developers. It's quick & easy.

click on a link with onClick

hi,

i'm trying to open a lightbox within a table cell with onClick, here is the code that works in firefox.. but it's not working in chrome.. is there a way?
or a better way to do this altogether?

Expand|Select|Wrap|Line Numbers
  1. <td onClick="document.getElementById('zorba').click()">Knye</td>
  2.  
  3. <a style="display: none;" href="knye.htm" title="Knye" id="zorba" rel="lightbox">Knye</a>
  4.  
Feb 12 '12 #1

✓ answered by Dormilich

according to the HTML-DOM there is indeed no click() method on the <a> element (ref.). however, Mozilla states that according to the new HTML5 specification (though I couldn't find that part) there should be and therefore Mozilla supports it. (ref.)

8 1817
Dormilich
8,651 Expert Mod 8TB
what does Chrome's Error Console say?
Feb 13 '12 #2
it says:
Uncaught TypeError: Object file:///F:/1002/kunye.htm has no method 'click'
Feb 13 '12 #3
Dormilich
8,651 Expert Mod 8TB
Object file:///F:/1002/kunye.htm
that's some strange kind of object ... can you put that page on a public server?
Feb 13 '12 #4
sure;

http://kutubhane.com/deneysel/exp/1002/gezinti.htm

it's the second top link from left.. "Künye"
Feb 13 '12 #5
Dormilich
8,651 Expert Mod 8TB
according to the HTML-DOM there is indeed no click() method on the <a> element (ref.). however, Mozilla states that according to the new HTML5 specification (though I couldn't find that part) there should be and therefore Mozilla supports it. (ref.)
Feb 13 '12 #6
thank you very much..

is there any other way to call that lightbox without using <a> ?
Feb 13 '12 #7
Dormilich
8,651 Expert Mod 8TB
why don't you bind the lightbox directly to that (calling) element?
Feb 13 '12 #8
i don't know how to do that :)
Feb 13 '12 #9

Post your reply

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

Similar topics

17 posts views Thread by Mike Gratee | last post: by
1 post views Thread by Miroslav Stampar [MCSD.NET / Security+] | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.