Opened 15 years ago
Closed 15 years ago
#2193 closed bug (invalid)
toggle( FunctionA reference to a Javascript function. evenThe function to execute on every even click., FunctionA reference to a Javascript function. oddThe function to execute on every odd click. )
Reported by: | windark | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | 1.2.3 |
Component: | core | Version: | 1.2.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
my code: $(document).ready(function(){
$('#btn_tog').click(function(){
$("li").toggle(
function () {
alert('1');
}, function () {
alert('2');
});
});
});
this code can't alert the message when i click the button.my jquery version is 1.2.2.
Note: See
TracTickets for help on using
tickets.
The posted code is not setup to alert on a button click. It is setup to alert when the user clicks on an li element, after clicking the button.
Your example is unclear about what your desired behavior is, but you probably wanted something more like: