This is a horrible way to do what you're attempting. First, you should probably not be useing the inline events when you have jQuery readily accessible to you. Second, you should never, ever, ever, ever, ever write a callback using inline styling onclick handling. Third, you should really put all your scripting in the head of the document. Makes it easier for maintainability.
<html> <head> <title> Test Page </title> <style type="text/css"> #a1 { width: 100px; height: 100px; background: #000 } </style> <script src="jquery-1.3.2.js" type="text/javascript"></script> <script type="text/javascript"> $(function(){ $('#a1').dblclick(function(){alert('2')}); }); </script> </head> <body> <div id="a1"></div> </body> </html> dblclick( fn ) On Mar 23, 12:16 pm, Vitaliy Katochka <vkatoc...@gmail.com> wrote: > Hello, > > After load this page, double click is not work in IE 7.0, Firefox > 3.0.7. But in Opera 9.64 is work. What wrong? Please advice. > > <html> > <head> > <script src="jquery-1.3.2.js"></script> > </head> > <body> > <div id="a1" ondblclick="alert('1');" style="width: 100px; > height: > 100px; background-color: > > #000;"> > </div> > <script> > $(document).ready( function() { > $("#a1").attr("ondblclick", "alert('2')"); > }); > </script> > <body> > </html>