Pen Settings

HTML

CSS

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

JavaScript

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

Packages

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.

Behavior

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.

HTML

              
                <h1>TEXTAREA LOSES CURRENT VALUE WHEN CLONED IN FIREFOX</h1>
<p class="subline"><a href="https://bugs.jquery.com/ticket/3016">jQuery Ticket #3016 (closed bug: patchwelcome)</a></p>
<p class="subline">This bug is still reproducible in Firefox 34.0.5</p>
<div class="summary">
  <h2>Description</h2>
  <blockquote>
    <p>If you clone an element with a textarea in it and append this to another element, the value of the textarea is lost (or - if in the html a value for the textarea was set - the default value is set).</p>
  </blockquote>
</div>

<p>The initial textarea has placeholder text:</p>

<div id="test-subject">
  <textarea placeholder="Placeholder Text"></textarea>
</div>

<div id="target">
  <p>The cloned textarea has a faulty value in Firefox and will not display placeholder text because of it:</p>  
</div>
<p>Focusing/blurring the textarea without input will cause the value to be reset and the placeholder to appear.</p>
              
            
!

CSS

              
                /** 
 * STYLINGS ARE IMMATERIAL FOR THIS DEMO
 *
 * All CSS only used for visual enhancements of the demo
 *
 */

body {
  font-family: Arial;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 25px;
}

#target {
  border: 1px solid #000;
  padding: 30px 50px 50px;
  margin-top: 50px;
  max-width: 500px;
}

h1 {
  margin-bottom: 10px;
}

h2 {
  font-size: 18px;
}

.subline {
  margin-bottom: 40px;
}

.summary {
  padding: 20px;
  background: #f5f5f5;
  margin-bottom: 40px;
}

blockquote {
  font-style: italic;
}
              
            
!

JS

              
                var clonedTextarea = $("#test-subject").clone();

$("#target").append(clonedTextarea);
              
            
!
999px

Console