2

In Jupyter notebook we may use some magic functions shortcuts like so:

%%javascript
element.text('Hi')

This outputs in the current cell as expected. (If I'm not mistaken element here stands for current cell in DOM of jupyter notebook).

'Hi'

Question: Is there a way to do the same with %%html? My naive attempt doesn't work.

%%html
<script>element.text('Hi');</script>

Notice that such construct works just fine.

%%html
<script>alert('Hi');</script>

I'm not that good with jQuery and notebook DOM structure, so some explanation will be welcome. I read a few similar questions, like 16852885 but fail to find the relevant analog.

garej
  • 460
  • 1
  • 7
  • 21

0 Answers0