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.

            
              <body>
    <div class="todo-container">
      <div class="top-bar">
        <h3>Todo List</h3>
        <button type="button" id="addItem">+</button>
      </div>
    </div>

  </body>
            
          
!
            
              *{margin: 0; padding: 0;}
      body{font-family: 'Raleway', sans-serif; font-weight: 600; background: #f2f2f2;}
      .todo-container{background: #f1f3f3; width: 100%; max-width: 767px; margin: 0 auto; box-shadow: 0px 0px 10px  rgba(0,0,0,0.5); padding-bottom: 20px;}
      .todo-container .top-bar{background: #066fc8; width: 100%; text-align: center; padding: 20px 0; position: relative; margin-bottom: 20px; }
      .todo-container .top-bar h3{display: inline-block; color: #f5f5f5; font-size: 30px; font-weight: 700;}
      #addItem{position: absolute; right: 1%; top: 50%; transform: translate(0,-50%); padding: 10px 20px; font-size: 20px; font-weight: 700; color: #f5f5f5; border: 2px solid #f5f5f5; border-radius: 5px;background: transparent; cursor: pointer; transition: all 0.3s linear 0s;}
      #addItem:hover{background: #f5f5f5; color: #222;}
      .fa-trash{color: #222; font-size: 20px; transition: all 0.3s linear 0s;}
      .fa-trash:hover{color: rgb(210, 17, 17);}


      .the-group{position: relative; display: block; height:50px; border-bottom: 1px dotted #484141; padding: 0 15px;}
      .the-group label,
      .the-group input{position: absolute; top: 50%; transform: translate(0,-50%); left: 1%; font-size: 14px;}
      .the-group label{z-index: 999; padding-left: 10px; font-size: 16px;}
      .the-group input{padding-left: 10px; display: none; height: 30px; width: 90%; background: transparent; border: none;}
      .none{display: none;}
      .pull-right{float:right; margin-top: 12px;}
            
          
!
            
              function addEverything()
{
  $('label').click(function(){
    var theValue = $(this).text();
    $(this).next('input').attr('value', theValue).css({'display':'block'});
    $(this).next('input').focus();
    $(this).text(' ');
  });

// To hide the input and display the label
  $('input').blur(function(){
    var aa = $(this).val();
    $(this).prev('label').text(aa);
    $(this).css({'display':'none'});
    $(this).next('button').attr('data-del', aa);
  });
}

function deleteParent()
{
  $('a').click(function(ev){
    ev.preventDefault();
    $(this).parent('div').remove();
  });
}

  $(document).ready(function(){
    deleteParent(); // To delete the particular row
    addEverything();
    
    //To add more inputs
    $('#addItem').click(function(){
      $('.todo-container').append('<div class="the-group"><label for="">New Item</label><input type="text" value="" /><a href="" class="delete pull-right"><i class="fa fa-trash"></i></a></div>');
      deleteParent();
      addEverything();
    });
  });
            
          
!
999px
Close

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.

Go PRO

Loading ..................

Console