Double click function in jQuery not working
I have two span elements on a page. when i call jquery double click function on both, the function is only called on the first element. I am using the following code:
<span id="shiftTime_1">1</span>
<span id="shiftTime_2">1</span>
and the jquery function:
$("[id^='shiftTime_']").dblclick(function() {
alert("hello");
});
when i double click on Id item shiftTime_1. then the function works fine. But when I double click on the Id item shiftTime_2, this function is unresponsive.
Please, help. Thanks to
+3
source to share
3 answers
When I try to execute the code, it works fine:
http://jsfiddle.net/Guffa/pfQfK/
Check if there is something different from your code.
+1
source to share