I can't get the button to call my javascript function and I'm starting to run in circles. I'm not very experienced in this area and to me it looks like all the examples I've seen.
<html>
<head>
<meta charset="utf-8" />
<meta name="format-detection" content="telephone=no" />
<!-- WARNING: for iOS 7, remove the width=device-width and height=device-height attributes. See https://issues.apache.org/jira/browse/CB-4323 -->
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />
<link rel="stylesheet" type="text/css" href="css/index.css" />
<title>BONJA</title>
</head>
<body>
<div class="app">
<div class="wrapper">
<div class="content">
<div class="head">
<img src="res/logo/institucional.png" />
</div>
<div class="container">
<form>
<input type="button" value="Fazer Login" onclick="login()" class="button" id="loginClick" />
</form>
</div>
<div id="deviceready" class="blink">
<p class="event notConnected">Não conectado</p>
<p class="event connecting">conectando</p>
<p class="event connected">conectado</p>
</div>
</div>
</div>
</div>
<script type="text/javascript" src="phonegap.js"></script>
<script type="text/javascript" src="js/index.js"></script>
<script type="text/javascript">
app.initialize();
</script>
<script type="text/javascript">
function login() {
//initialize login
var parentElement = document.getElementByID('deviceready');
var notConnectedElement = parentElement.querySelector('.notConnected');
var connectingElement = parentElement.querySelector('.connecting');
notConnectedElement.setAttribute('style', 'display:none;');
connectingElement.setAttribute('style', 'display:block;');
alert("Hello world!");
}
</script>
</body>
Im testing everything on the iPhone Simulator by the way.
Thanks for your help