In this article I’ll show you how to add this custom functionality to CKEditor, one of the usable editors in Liferay.
An alternative for jsFiddle is Plunker, where you can create code and then run it. Alternatively you can browse between the codes (called Plunks) added by other users.
So this is a bit sophisticated and similar to a website: write here, copy the code (all the files) and add it to your site. And because it is similar to a live website, you can use other JS libraries too, for example GoogleCharts.
I’d say give it a try too – and when not to code then to browse among the plunks.