Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ add another resource


Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource


Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.


Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.


                <h2>Character Count</h2>

<div class="box">
  <textarea name="str" id="str" placeholder="TYPE or PASTE your text here..."></textarea>
  <div class="data">
    <p>Characters: <span class="chars">0</span></p>
    <p>Letters: <span class="letters">0</span></p>
    <p>Words: <span class="words">0</span></p>
    <p>Sentences: <span class="sentences">0</span></p>
    <p>Paragraphs: <span class="lines">0</span></p>



                /* Styles are not required */
* {
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;

body {
  background: #FFECB3;

h2 {
  margin: 60px auto 35px auto;
  font-family: sans-serif;
  letter-spacing: 1px;
  color: #673AB7;
  text-align: center;

.box {
  width: 360px;
  max-width: 90%;
  margin: 0 auto;
  background: #FFC107;
  border-radius: 6px;
  box-shadow: 0px 20px 40px -15px rgba(245,187,39,1);

#str {
  width: 100%;
  height: 200px;
  padding: 2em;
  border: 0;
  border-radius: none;
  border-radius: 6px 6px 0 0;
  outline: none;
  background: #ffffff;
  resize: vertical;

.data {
  padding: 1em 2em;

.data p {
  font-family: sans-serif;
  letter-spacing: 1px;
  color: #ffffff;

.data p span {
  font-weight: normal;



Hi! Welcome to my little playground!

My name is Tobias Bogliolo. 'Open source' by default and always 'responsive',
I'm a publicist, visual designer and frontend developer based in Barcelona. 

Here you will find some of my personal experiments. Sometimes usefull,
sometimes simply for fun. You are free to use them for whatever you want 
but I would appreciate an attribution from my work. I hope you enjoy it.


Create prototype:
$.fn.strCount = function() {
  //Get string:
  str = this.val();
  //Pprevent 'null' value if the sting is empty:
  var numChars = 0;
  var numLetters = 0;
  var numWords = 0;
  var numSentences = 0;
  var numLines = 0;
  if(str) {
    numChars = str.length; //Count chars.
    numLetters = str.replace(/\s+/g, '').length; //Count chars without spaces.
    numWords = str.match(/\S+/g).length; //Count words.
    numSentences = str.split(/\.+[\n|\s]/g).length; //Count sentences.
    numLines = str.split(/\r*\n/).length; //Count lines.
  //Return data:
  return {

  //Get object:
  var objCount = $("#str").strCount();
  //Print data: