Create runnable snippets on your Wordpress blog

Posted on

Here’s how to create a runnable snippet on your WordPress blog.

$(function() {
        var that = this;
        var button = $('<p><button class="btn btn-default">Run Snippet</button></p>');

You need to create a pre element with the class .js-runnable. The upper script will the automatically add a button after the code to run the code inside the snippet.


    var a = 'World';
    alert('Hello '+a);

Leave a Reply