B5107656409
Posts: 0
Joined: Thu Jul 23, 2015 6:39 am

how to attach function to click event to a mobilebutton_16?

how to attach function to click event to a mobilebutton_16?

I run this code in Page Show:

document.getElementById('mobilebutton_16').addEventListener("Click", responsiveVoice.clickEvent);

but I got the following error:

Uncaught TypeError: Cannot read property 'addEventListener' of null
at HTMLDivElement.pageshow (https://appery.io/app/view/52036020-4...)
at HTMLDivElement.dispatch (https://appery.io/app/view/52036020-4...)
at HTMLDivElement.elemData.handle (https://appery.io/app/view/52036020-4...)
at Object.trigger (https://appery.io/app/view/52036020-4...)
at HTMLDivElement. (https://appery.io/app/view/52036020-4...)
at Function.each (https://appery.io/app/view/52036020-4...)
at jQuery.fn.init.each (https://appery.io/app/view/52036020-4...)
at jQuery.fn.init.trigger (https://appery.io/app/view/52036020-4...)
at $.(anonymous function).(anonymous function).triggerWithDeprecated (https://appery.io/app/view/52036020-4...)
at $.(anonymous function).(anonymous function).triggerWithDeprecated (https://appery.io/app/view/52036020-4...)
pageshow @ Screen13.js:222
dispatch @ jquery-2.1.1.js:4409
elemData.handle @ jquery-2.1.1.js:4095
trigger @ jquery-2.1.1.js:4324
(anonymous) @ jquery-2.1.1.js:4875
each @ jquery-2.1.1.js:375
each @ jquery-2.1.1.js:139
trigger @ jquery-2.1.1.js:4874
_triggerWithDeprecated @ jquery.mobile-1.4.5.js:5020
(anonymous) @ jquery.mobile-1.4.5.js:835
_triggerCssTransitionEvents @ jquery.mobile-1.4.5.js:5320
(anonymous) @ jquery.mobile-1.4.5.js:835
(anonymous) @ jquery.mobile-1.4.5.js:5344
proxy @ jquery-2.1.1.js:513
fire @ jquery-2.1.1.js:3073
add @ jquery-2.1.1.js:3119
_cssTransition @ jquery.mobile-1.4.5.js:5343
(anonymous) @ jquery.mobile-1.4.5.js:835
transition @ jquery.mobile-1.4.5.js:5691
(anonymous) @ jquery.mobile-1.4.5.js:835
change @ jquery.mobile-1.4.5.js:5467
(anonymous) @ jquery.mobile-1.4.5.js:835
(anonymous) @ jquery.mobile-1.4.5.js:933
each @ jquery-2.1.1.js:375
each @ jquery-2.1.1.js:139
$.fn.(anonymous function) @ jquery.mobile-1.4.5.js:919
$.mobile.changePage @ jquery.mobile-1.4.5.js:5844
initializePage @ jquery.mobile-1.4.5.js:15386
(anonymous) @ jquery.mobile-1.4.5.js:15427
fire @ jquery-2.1.1.js:3073
fireWith @ jquery-2.1.1.js:3185
ready @ jquery-2.1.1.js:3391
completed @ jquery-2.1.1.js:3407
JavaScript4.js:62 RV: Voice support ready

Return to “Issues”