cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

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. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

Quick-add: + add another resource

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.

Quick-add: + add another resource

Code Indentation

     

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.

            
              <div id="test-1">
  Here are emojis that use the default prefix and suffix:
  :smile:
  :wink:
  :delicious:
</div>
<br/>
<div id="test-2">
  Here are emojis that use a custom prefix and suffix: 
  --smile--
  --wink--
  --delicious--
</div>
<br/>
<div id="test-3">
  Here are emojis that work in a certain class:
  :smile: (that shouldn't work)
  <span class="emojify-emoji">:smile: :wink: :delicious:</span> (those should work)
</div>
            
          
!
            
              
(function(){var emojify=function(prefix,suffix){prefix=(prefix===undefined)?':':prefix;suffix=(suffix===undefined)?':':suffix;if(this===HTMLElement||this===NodeList||this===HTMLCollection){return new emojify(prefix,suffix)}this.parent=this;this.emojis={'smile':'1F60A','frown':'1F621','pouting':'1F621','grin':'1F600','grinning':'1F600','bigsmile':'1F604','laughcry':'1F602','wink':'1F609','kiss':'1F617','hearteyes':'1F60D','tongueout':'1F61B','tongueoutwink':'1F61C','cry':'1F622','crying':'1F622','angry':'1F623','scream':'1F631','schocked':'1F632','gasp':'1F632','unamused':'1F612','confused':'1F615','noexpression':'1F611','smilewithhorns':'1F608','relieved':'1F60C','sunglasses':'1F60E','worried':'1F61F','fearful':'1F628','triumph':'1F624','sleeping':'1F634','dizzy':'1F635','nomouth':'1F636','blankstare':'1F636','medicalmask':'1F637','halo':'1F607','angel':'1F607','tonguelick':'1F60B','delicious':'1F60B',};this.replaceEmojis=function(elem){var html=elem.innerHTML;for(var emoji in this.emojis){html=html.replace(new RegExp(prefix+emoji+suffix,'g'),'&#x'+this.emojis[emoji]+';')}return html};this.replace=function(){if(this.parent instanceof NodeList||this.parent instanceof HTMLCollection){for(var i=0;i<this.parent.length;i++){this.parent[i].innerHTML=this.replaceEmojis(this.parent[i])}}else{this.parent.innerHTML=this.replaceEmojis(this.parent)}return};this.replace();return this};if(!HTMLElement.prototype.emojify){HTMLElement.prototype.emojify=emojify}if(!NodeList.prototype.emojify){NodeList.prototype.emojify=emojify}if(!HTMLCollection.prototype.emojify){HTMLCollection.prototype.emojify=emojify}}());
window.addEventListener('load', function(){
  // Default prefix and suffix 
  document.getElementById('test-1').emojify();

  // Custom prefix and suffix 
  document.getElementById('test-2').emojify('--', '--');

  // In a certain class only 
  document.getElementsByClassName('emojify-emoji').emojify();

});

            
          
!
999px
Loading ..................

Console