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.


Auto Save

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.


  <select name="color picker" id="color-picker">
    <option value="red">โค๏ธ RED</option>
    <option value="blue">๐Ÿ’™ BLUE</option>
    <option value="yellow">๐Ÿ’› YELLOW</option>
    <option value="green">๐Ÿ’š GREEN</option>
    <option value="black">๐Ÿ–ค BLACK</option>
    <option value="purple">๐Ÿ’œ PURPLE</option>
    <option value="orange">๐Ÿงก ORANGE</option>
    <option value="white">๐Ÿค WHITE</option>

  <button>Change Color!</button>


                main {
  text-align: center;

div {
  height: 80px;
  width: 80px;
  background-color: black;
  margin: auto;

select {
  border: none;
  margin-top: 15px;

select:hover {
  cursor: pointer;

button {
  border: none;
  background-color: lightgray;
  padding: 5px;
  border-radius: 10px;

button:hover {
  background-color: gray;
  cursor: pointer;


                // Prompt: When the user clicks the Change Color button, the div should change colors to match the color of the heart selected in the dropdown menu. For example, if they select ๐Ÿ’š (green heart) and click the button, the div should turn green.

// goal: When the button is clicked, the div's background color should change to whatever color is selected in the drop down menu

// data/what do I need access to?:
  // HTML elements: div, select, button
  // CSS properties: background-color
  // JS variables: none that exist, but I will make some to store HTML elements

// steps:
  // grab 3 HTML elements and store as variables
  // add event listener to button and fire function on click
  // function:
    // grab value from select element (.value)
    // reassign background color of div (using style.backgroundColor)

// code:
var box = document.querySelector('div');
var colorSelector = document.querySelector('select');
var button = document.querySelector('button');

button.addEventListener('click', changeBoxColor);

function changeBoxColor() {
  var newColor = colorSelector.value; = newColor;