RogerW
1
I am trying to retrieve a variable and using that variable data to print as a heading.
This is the code I am using but it is not working.
function getOrdinanceType() {
var ordinanceType = "Process " + window.KeyboardMaestro.GetVariable("Ordinance");
return ordinanceType;
}
</script>
<div id="title">
<h2><p>ordinanceType</p><p></p>
</div>
Thanks
Roger
It should be something like the following:
<html>
<head>
</head>
<body data-kmwindow="SCREEN(Main,Left,35%),SCREEN(Main,Top,17%),900,800" style="width: 100%;">
<div id="title">
<h2 id="tHeader">ordinanceType</h2>
</div>
<script>
function KMInit() {
const ordinanceType = "Process " + window.KeyboardMaestro.GetVariable("Ordinance");
document.querySelector("#tHeader").innerText = ordinanceType;
}
</script>
</body>
</html>
1 Like