How to show sandbox for the JS code

I was wondering how I would show snipped of JS code on my website. This sandbox should also include the line number. I was going through the JS tutorial web site and saw an example there that looks like this…

image

This looks to have the information you need.

Note: There are plug-ins for prism and highlightjs for things like line numbers e.g.
https://prismjs.com/plugins/line-numbers/
http://wcoder.github.io/highlightjs-line-numbers.js/

1 Like