This is an experimental feature and script tags may change in the future. However, please give it a try and feel free to provide feedback.
PDF supports JavaScript for various purposes, such as form validation. However, please note that typeset.sh itself does not parse JavaScript like a browser would. Instead, scripts are attached to the PDF and executed by the client's PDF viewer application.
Not all viewer support all futures and events.
To include <script> tags, the data-pdf attribute must be present. This precaution is taken to avoid including any scripts by default.
PDF supports document event handlers that can be subscribed to by adding the attribute data-on="EventType". The following event types are available:
WillClose
WillSave
DidSave
WillPrint
DidPrint
Ohter ineraction events (onclick, onmousedown, etc.) only work on form fields.