Pablo
Pablo

Reputation: 2854

Capture filter clear click event in jQueryMobile

How can I capture the event of clicking in the filter clear button for a listview component in jQueryMobile?

I have tried selectors $('.ui-input-clear'), $('.ui-input-search a'), $('.ui-input-search :not(input)'),... but I can not find the solution.

In jsfiddle works right, but I am developing for iOS and Android platforms.

Upvotes: 3

Views: 2506

Answers (2)

Jhonatan Avila Garcia
Jhonatan Avila Garcia

Reputation: 21

$(document).on('click', '.ui-input-clear', function () {
//code here 
});

Response for new features of Jquery and Jquery mobile

Upvotes: 0

MysteriousFist
MysteriousFist

Reputation: 426

This is old, but it comes up on the Googles so:

Instead of registering a click event, try registering a tap event.

$('.ui-input-clear').live('tap', function () {
    // Your code here
});

Upvotes: 4

Related Questions