Demoing and displaying JavaScript at the same time using CSS

 Demoing and displaying JavaScript at the same time using CSS

When writing documentation or doing examples you constantly run into the same issue: how do you display and demo the code at the same time? You don’t want to have a code display and live code as they will get out of sync (on the other hand I always found that when copying code into a document I also cleaned it up and optimised it).

The easiest way for this are all the “new” services like JSFiddle, JSBin, Dabblet, Tinker.io and others (there seems to be a new one every month now) and you can even embed them

What the influencers are saying

  1. Patrick Mueller

    407.0 days ago

    haha - set CSS display:block for script elements - http://t.co/RTKb967e

  2. Christian Heilmann

    407.0 days ago

    Demoing and displaying JavaScript code at the same time using CSS: http://t.co/F7o3WvkA (/ht @mathias)



Related Reading




InformationWeek encourages readers to engage in spirited, healthy debate, including taking us to task. However, InformationWeek moderates all comments posted to our site, and reserves the right to modify or remove any content that it determines to be derogatory, offensive, inflammatory, vulgar, irrelevant/off-topic, racist or obvious marketing/SPAM. InformationWeek further reserves the right to disable the profile of any commenter participating in said activities.

Disqus Tips To upload an avatar photo, first complete your Disqus profile. | View the list of supported HTML tags you can use to style comments. | Please read our commenting policy.