Skip to content
Discussion options

You must be logged in to vote

OJS is not javascript: you'll need to go through observablehq's tutorials to learn how to use their interactive features.

If you want to use plain javascript in your HTML files you can do that with raw HTML blocks:

```{=html}
<script>
function generateRandomNumber() {
    var randomNumber = Math.floor(Math.random() * 100) + 1;
    alert("Your random number is: " + randomNumber);
}
</script>
<button onclick="generateRandomNumber()">Generate Random Number</button>
```

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@jmhimara
Comment options

@cscheid
Comment options

Answer selected by jmhimara
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants