Reputation: 13
I ve got a html page with only a table with two rows and i want to add an dobleclick event via jQuery. My problem is that this code don´t run, but if i use javascript console of chrome and type manually the code, code runs.
$(document).ready(function () {
$('tr').dblclick(function(){
alert('Row dblclicked');
});
}
What's the problem?
Upvotes: 0
Views: 491
Reputation: 7427
You just have a syntaxt problem:
$(document).ready(function () {
$('tr').dblclick(function(){
alert('Row dblclicked');
});
});
and it works: http://jsfiddle.net/bouillard/xGgFx/
Upvotes: 0
Reputation: 103388
The issue is because you are not ending your parentheses for $(document).ready()
You are missing );
right at the end of your script.
Try changing your code to:
$(document).ready(function() {
$('tr').dblclick(function(){
alert('Row dblclicked');
});
});
http://jsfiddle.net/Curt/SQzt6/4/
Upvotes: 2