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.


    <legend>Fill Out Form With Speech Recognition (Chrome)</legend>
    <code id="result">live transcript here ...</code>
    <button type="button" id="toggle">Toggle listening</button>
    <p>Click on “Toggle listening”, then click on the form field, where you want to insert speeched text. Pause a bit after a sentence to process the speech-data. This demo only works with language <strong>“en-US”</strong>, only in Chrome, and only if you allow the microphone on this page!</p>
    <label>Field 1<input /></label>
    <label>Field 2<input /></label>
    <label>Field 3<input /></label>
    <label>Field 4<textarea></textarea></label>


                * {
  box-sizing: border-box;
body {
  --gap: 1rem;
  font-family: ui-sans-serif, system-ui, snas-serif;
button {
  background-color: hsl(90, 50%, 30%);
  border: 0;
  color: hsl(90, 50%, 95%);
  margin-block-start: var(--gap);
  padding: calc(var(--gap) / 2) var(--gap);
button.listening {
  background-color: hsl(0, 50%, 50%);
  color: hsl(0, 50%, 95%);
code {
  background: #333;
  color: lime;
  display: block;
  padding: calc(var(--gap) / 2);
fieldset {
  background: #EEE;
  border: 1px solid #BBB;
  padding: var(--gap);
form {
  margin: 0 auto;
  max-width: 30rem;
input, textarea {
  border: 1px solid #BBB;
  display: block;
  padding: calc(var(--gap) / 2);
  resize: vertical;
  width: 100%;
label {
  display: block;
  font-weight: 500;
  margin-block-start: var(--gap);
p {
  font-size: small;


                function init() {
  window.SpeechRecognition = window.SpeechRecognition || window.webkitSpeechRecognition;
  if (('SpeechRecognition' in window || 'webkitSpeechRecognition' in window)) {
    let speech = {
      enabled: true,
      listening: false,
      recognition: new window.SpeechRecognition(),
      text: ''
    speech.recognition.continuous = true;
    speech.recognition.interimResults = true;
    speech.recognition.lang = 'en-US';
    speech.recognition.addEventListener('result', (event) => {
      const audio = event.results[event.results.length - 1];
      speech.text = audio[0].transcript;
      const tag = document.activeElement.nodeName;
      if (tag === 'INPUT' || tag === 'TEXTAREA') {
        if (audio.isFinal) {
          document.activeElement.value += speech.text;
      result.innerText = speech.text;

    toggle.addEventListener('click', () => {
      speech.listening = !speech.listening;
      if (speech.listening) {
        toggle.innerText = 'Listening ...';
      else {
        toggle.innerText = 'Toggle listening';