In Coda on my iPad Pro I have the following two files in a single directory that I named assets. When I try to preview the template.html file either in Coda or Safari (in side by side mode) I cannot get any interaction with javascript calls on events.
I have consulted the panic library regarding this and tried searching if similar issues have been encountered, but to no avail. The documentation clearly states that html/css/javascript rendering is supported by the preview functionality of Coda.
I have tried including the script directly in the head, the body, importing in a script tag and importing in a source tag and none have worked. CSS styling works as expected. I have tried many iterations that I won't list below, but this is the simplest case that I'm currently working with.
assets/template.html
<!DOCTYPE html>
<html>
<head>
<source type="text/javascript" src="assets/scripts.js"></source>
</head>
<body>
<h1 class="myheader" id="theheader">Hello?</h1>
<button onclick="doStuff()">click me</button>
</body>
</html>
assets/scripts.js
doStuff(){
document.getElementById('theheader').style.color = 'red';
}