Simple windowed application: Difference between revisions

Restored JavaFX Script, added JavaScript as presumably intended (untested), see talk page
(Undo revision 338228 by Mellington (talk))
(Restored JavaFX Script, added JavaScript as presumably intended (untested), see talk page)
Line 1,838:
}
}</lang>
 
=={{header|JavaScript}}==
<lang JavaScript>
<html>
<head>
<title>Simple Window Application</title>
</head>
 
<body>
<br> &nbsp &nbsp &nbsp &nbsp
 
<script type="text/javascript">
var box = document.createElement('input')
box.style.position = 'absolute'; // position it
box.style.left = '10px';
box.style.top = '60px';
document.body.appendChild(box).style.border="3px solid white";
document.body.appendChild(box).value = "There have been no clicks yet";
document.body.appendChild(box).style['width'] = '220px';
var clicks = 0;
function count_clicks() {
document.body.appendChild(box).remove()
clicks += 1;
document.getElementById("clicks").innerHTML = clicks;
};
</script>
 
<button type="button" onclick="count_clicks()"> Click me</button>
<pre><p> Clicks: <a id="clicks">0</a> </p></pre>
</body>
 
</html>
</lang>
 
=={{header|Julia}}==
7,805

edits