I was testing out HTML Macro, enabled by our admin, by using a very simple page, including a simple JScript. The HTML was running fine if directly loaded into browser (I use Chrome), however it doesn't work if included as part of confluence page. The code is like this, and "action="javascript:handleIt()"" is not calling the function "handleit" at all when this code is part of confluence page. Please help me understand. Thanks.
<!DOCTYPE html>
<html>
<head>
<style>
table {
font-family: arial, sans-serif;
border-collapse: collapse;
width: 100%;
}
td, th {
border: 1px solid #dddddd;
text-align: left;
padding: 8px;
}
tr:nth-child(even) {
background-color: #dddddd;
}
</style>
<script type="text/javascript">
function handleIt() {
alert("hello");
}
</script>
</head>
<body>
<form name="CandidateTable" action="javascript:handleIt()">
First name:<input type="text" name="fname"><br>
Last name: <input type="text" name="lname"><br>
<input name="Submit" type="submit" value="Add Candidate"/>
</form>
</body>
</html>