Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs 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 its URL and the proper URL extension.

+ 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.


                <h1>Copy the content of an Input element</h1>
<div id="infoBox">
  Tutorial by CodingIsEasy. <a href=""></a> is the best platform for <strong>web developers</strong>.
<div id="inputContainer">
    <input type="text" value="Coding Is Easy" id="myInput">
    <button onclick="copyIsEasy()" id="copyBtn">Copy</button>
<div id="copiedText"></div>


                // Source Code by
<!DOCTYPE html>
body {
  margin: 50px;
a {
  color: red;
  font-weight: bold;
  text-decoration: none;
button {
  width: 70px;
  height: 40px;
  background-color: black;
  color: white;  
  margin: 20px 0px;
  border-radius: 10px;
  cursor: pointer;
#inputContainer {
  margin: 20px 0px;
#infoBox {
  width: 100%;
  background-color: pink;
  color: black;
  padding: 20px;
  border-radius: 10px;
  box-sizing: border-box;
#myInput {
    height: 32px;
    border-radius: 5px;


function copyIsEasy() {
  /* Get the text field */
  var copyText = document.getElementById("myInput");
  /* Select the text field */;
  copyText.setSelectionRange(0, 99999); /* For mobile devices */
  /* Copy the text inside the text field */
  /* Alert the copied text */
  document.getElementById("copyBtn").innerHTML = "Copied";
  document.getElementById("copiedText").innerHTML = "<strong>You've Copied:</strong> " + copyText.value;