It is possible to put custom js code inside Rmarkdown documents.
Table of Contents
We can just embed any html tag such as
style directly inside the Rmarkdown text. They will be included in the final html output.
<script>window.alert("hello")</script> <script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.2.0/require.min.js"></script>
Or we can use the usual code blocks.
JQuery is already included with Rmarkdown. So, we can use JQuery functions directly: