I need to rewrite this on function to a click function. with the exact same functionality.
I cant use on since I have to use jQuery 1.3
$('#citybreak_availability_calendar_widget').on('click', '#CB_SearchButton', function() {
var iframe = $('#citybreakContent').find('iframe');
iframe.attr('src', $(this).attr('href'));
$('#menu ul li a[title="Boka rum"]').click();
return false;
});
And this is what I got:
$('#citybreak_availability_calendar_widget #CB_SearchButton').click(function() {
var iframe = $('#citybreakContent').find('iframe');
iframe.attr('src', $('#CB_SearchButton').attr('href'));
$('#menu ul li a[title="Boka rum"]').click();
return false;
});
Here:
Since you use version 1.3 which doesn’t provide event delegation out-of-the-box, you’ll have to implement it manually. The idea is to bind the click handler to the wrapper element, and then – inside the handler – manually check if the event target – the
e.targetproperty – is the correct element.