-
DescriptionI know you can easily reference ojs variables in markdown, for example: ```{ojs}
viewof x = Inputs.button("Button")
```
${x} However this doesn't seem to work within html cells. Is something like this possible, without resorting to DOM manipulation? For example (using ```{ojs}
viewof x = Inputs.button("Button")
```
```{=html}
<div>
<h2> Example HTML code block <h2>
Number of clicks: ${x}
<div>
``` |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 10 replies
-
You are talking about "html cells", but there is no such thing in your example. Could you share a small "working" (reproducible) example to work with, i.e., a complete Quarto document or a Git repository? Thanks. You can share a Quarto document using the following syntax, i.e., using more backticks than you have in your document (usually four ````qmd
---
title: "Reproducible Quarto Document"
format: html
---
This is a reproducible Quarto document using `format: html`.
It is written in Markdown and contains embedded R code.
When you run the code, it will produce a plot.
```{r}
plot(cars)
```
The end.
```` |
Beta Was this translation helpful? Give feedback.
It's possible using raw code blocks and raw inline code.
`<p>raw inline html</p>`{=html} followed by normal markup