V
V
Vladimir2016-04-20 18:17:14
JavaScript
Vladimir, 2016-04-20 18:17:14

Why doesn't JavaScript work in Cordova?

Good day. Created an empty Cordova project and included jQuery Mobile. When I just write document.getElementById('area').innerHTML = "Hello"; it shows Hello in the emulator, but when I want to do it in a function so that this message is displayed when the button is pressed, nothing happens.

function show() {
    document.getElementById('area').innerHTML = "Hello";
}
<input type="button" value="Показать" onclick="show()" />

I work in Visual Studio 2015 and emulate through Ripple - Nexus (Galaxy). What could be the problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey, 2016-04-21
@MasterGerold

document.getElementById('show-area').addEventListener('click', function() {
// do what you have to :)
});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question