I try to create button which starts an alert after a click event. Something like that :
Apache
onclick is not fired on cordova apps, because users don't "click", instead, they "tap". You may use a decent mobile framework like Ionic, and use ng-click
, it automatically solves the problem for you, because it includes ngTouch
.
If you prefer not to use a big framework like angular, you may use Zepto.js
, and use $(".element").on('tap', callback);
to listen for tap events. Or $(".element").on('tap click', callback);
to listen for both tap and click events.
Chrome dev tools has good mobile emulation, to trigger tap events. It may be helpful if you want to debug you app in Chrome.