In the DIV there is js like: onclick, onkey down etc.. How do I set this up on a new javascript file without losing the functionality. I already have a external js file. And I want to add the 'onclick' stuff in there. But I'm not sure how to do it, and to make it work.
Can someone help me?
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<link rel="stylesheet" type="text/css" href="raad.css">
</head>
<body>
<h1>This is a Heading</h1>
<p>This is a paragraph.</p>
<div id="container">
<h1>Raad het goede nummer!</h1>
<div id="message_txt"></div>
<form id="userInput" name="userInput" method="post">
<input id="input_txt" name="limitedtextfield" type="text" onKeyDown="limitText(this.form.limitedtextfield,3);" onKeyUp="limitText(this.form.limitedtextfield,3);" maxlength="3">
<br />
<button id="guess_btn" type="button" onclick="guessNumber()">RAAD</button>
<br />
<button id="playAgain_btn" type="button" onclick="initGame()">OPNIEUW</button>
</form>
</div>
<script type="text/javascript" src="raad.js"></script>
</body>
</html>