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 CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

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.

              <select id="language">
<button id="toggleButton">Start listening</button>
  <div id="transcript"></div>
  <div id="confidence"></div>
              #transcript {
  border: 1px solid #ccc;
  height: 100px;
              var toggleButton = document.getElementById('toggleButton');
var transcript = document.getElementById('transcript');
var confidence = document.getElementById('confidence');
var language = document.getElementById('language');

if (!('webkitSpeechRecognition' in window)) {
  transcript.innerText = 'The speech recognition API is not supported by this browser. To see this demo, try running Chrome version 25 or later.';
  toggleButton.disabled = true;
  language.disabled = true;

var recognizer = new webkitSpeechRecognition();
var isListening = false;

recognizer.continuous = true;
recognizer.interimResults = true;

recognizer.onresult = function(event) {
  transcript.innerText = '';
  for (var i = 0; i < event.results.length; i++) {
    transcript.innerText += event.results[i][0].transcript;
    confidence.innerText = 'confidence: ' + event.results[i][0].confidence;

var toggleListening = function(event) {
  isListening = !isListening;
  if (isListening) {
    event.target.innerText = 'Stop listening';
    recognizer.lang = language.options[language.selectedIndex].value;
    language.disabled = true;
  } else {
    event.target.innerText = 'Start listening';
    language.disabled = false;
    transcript.innerText = '';
    confidence.innerText = '';

toggleButton.addEventListener('click', toggleListening);
Loading ..................