I have a script that helps to annotate an image. i Just want to run this script only when i click the button. I've tried to use the event onclick for the button but it is not working. Here is the code
<head>
<script src="javascripts/jquery.js"></script>
<script src="javascripts/jquery-ui.min.js"></script>
<link rel="stylesheet" href="stylesheets/jquery-ui.css">
////////////// those are the scripts that i use in the function //////
<link rel="stylesheet" href="highlight.js/zenburn.css">
<link rel="stylesheet" href="stylesheets/css/theme-dark/annotorious-dark.css" />
<script src="highlight.js/highlight.pack.js"></script>
<script src="javascripts/annotorious.min.js"></script>
/////////////
<script>
$("#annotation").click(function() {
hljs.initHighlightingOnLoad();
//function of annotation
});
</script>
</head>
<body>
<button type="submit" id="annotation" >
<img src="stylo.png" style="width: 30px ; height:50px" alt="Submit">
</button>
</body>
But this is not working , i still have the script running when i load the page. I just need to call it when the button " annotation" is clicked.
console?submit buttonwrapped inform?