It is possible to put custom js code inside Rmarkdown documents.

Table of Contents

Embedding <script> tag

We can just embed any html tag such as script or style directly inside the Rmarkdown text. They will be included in the final html output.


<script src=""></script>

Embedding js blocks

Or we can use the usual code blocks.

JQuery is already included with Rmarkdown. So, we can use JQuery functions directly: