I write some Javascript code using jQuery that should insert a symbol into one div when you click on another div. Nothing happens.
I used some code to check if jQuery loaded properly and it is.
HTML:
<html>
<head>
<link rel="stylesheet" href="styles.css">
<meta charset="UTF-8">
<!--<script src="jquery-3.4.1.js"></script>-->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="keyboard.js"></script>
<title>Keyboard Test</title>
</head>
<body>
<div class="field"></div>
<div class="key" id="a key"></div>
</body>
</html>
Javascript:
$(".key").click(function(event) {
$(".field").text="a";
alarm("asdfsdf");
});
No error messages.
Also tried this:
$(".key").on("click",function() {
alarm("asdfsdf");
$(".field").text="a";
});