Click here to Skip to main content
15,891,920 members
Please Sign up or sign in to vote.
1.50/5 (2 votes)
in ordinary index.html. I added button:

<input type="button" id="btnTest" value="Click me" />


in index.js:
function onDeviceReady() {
// Handle the Cordova pause and resume events
document.addEventListener( 'pause', onPause.bind( this ), false );
document.addEventListener( 'resume', onResume.bind( this ), false );
document.getElementById("btnTest").click(function () {
alert("Testing");
})
};
Posted
Comments
Mohibur Rashid 14-Dec-15 17:49pm    
Your addeventlistener method is incorrect. Read the linkhttp://www.w3schools.com/jsref/met_document_addeventlistener.asp
Yoqubjon Kholmatov 15-Dec-15 0:57am    
Thank you! It helped.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900