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. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ 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

              
                <!DOCTYPE html>
<html lang="en" >
<head>
  <meta charset="UTF-8">
  <title>CodePen - HTML 5.2 new dialog tag</title>
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css">
<link rel='stylesheet' href='https://fonts.googleapis.com/css?family=Montserrat:200,400,700'><link rel="stylesheet" href="./style.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>

</head>
<body>
<!-- partial:index.partial.html -->
<!-- Simple boîte de dialogue, contenant un formulaire -->
<dialog id="favDialog">
  <form method="dialog">
    <section>
      <input type="text" name="fname" id="fname"><br><br>
        <input type="text" name="lname" id="lname"><br><br>
        <input type="text" name="age" id="age"><br><br>
    </section>
    <menu>
      <button id="cancel" type="reset">reset</button>
      <button id="submit" type="submit">submit</button>
    </menu>
  </form>
</dialog>

<table id="table" border="1">
            <tr>
                <th>First Name</th>
                <th>Last Name</th>
                <th>Phone</th>
                <th>settings</th>
            </tr>
            
            <tr>
                <td>FN1</td>
                <td>LN1</td>
                <td>111</td>
                <td><a id="updateDetails">edit(нажми на меня)</a></td>
            </tr>
            
            <tr>
                <td>FN2</td>
                <td>LN2</td>
                <td>211</td>
                <td><a id="updateDetails">edit</a></td>
            </tr>
            
            <tr>
                <td>FN3</td>
                <td>LN3</td>
                <td>311</td>
                <td><a id="updateDetails">edit</a></td>
            </tr>
            
            <tr>
                <td>FN4</td>
                <td>LN4</td>
                <td>411</td>
               <td><a id="updateDetails">edit</a></td>
            </tr>
            
            <tr>
                <td>FN5</td>
                <td>LN5</td>
                <td>511</td>
                 <td><a id="updateDetails">edit</a></td>
            </tr>
        </table>
  

<!-- partial -->
  <script  src="./script.js"></script>
      <script>
    
                var table = document.getElementById('table');
                
                for(var i = 1; i < table.rows.length; i++)
                {
                    table.rows[i].onclick = function()
                    {
                         //rIndex = this.rowIndex;
                         document.getElementById("fname").value = this.cells[0].innerHTML;
                         document.getElementById("lname").value = this.cells[1].innerHTML;
                         document.getElementById("age").value = this.cells[2].innerHTML;
                    };
                }
    
         </script>

</body>
</html>

              
            
!

CSS

              
                * {
  font-family: "Montserrat", sans-serif;
}

dialog#favDialog::backdrop {
  background: linear-gradient(135deg, rgba(207, 161, 252, 0.6) 0%, rgba(113, 102, 240, 0.6) 100%);
}

menu.card {
  margin: 30px auto;
  width: 480px;
  height: 200px;
  box-shadow: 5px 5px 100px rgba(0, 0, 0, 0.1);
  padding: 15px;
  text-align: center;
}
menu.card p {
  color: #444;
  font-size: 2rem;
  font-weight: 700;
}

button {
  background: #7367F0;
  background: linear-gradient(135deg, #CE9FFC 0%, #7367F0 100%);
  padding: 10px 15px;
  border-radius: 50px;
  box-shadow: 5px 5px 100px rgba(0, 0, 0, 0.1);
  border: none;
  color: white;
  cursor: pointer;
  transition: background 500ms ease;
}
button:hover {
  background: #CE9FFC;
  background: linear-gradient(135deg, #CE9FFC 0%, #CE9FFC 100%);
}
button#cancel {
  background: #E3E3E3;
  background: linear-gradient(135deg, #E3E3E3 0%, #5D6874 100%);
}
button#cancel:hover {
  background: #5D6874;
  background: linear-gradient(135deg, #E3E3E3 0%, #E3E3E3 100%);
  color: #333;
}
              
            
!

JS

              
                (function() {
    var updateButton = document.getElementById('updateDetails');
    var cancelButton = document.getElementById('cancel');
		var submitButton = document.getElementById('submit');

    // Update button opens a modal dialog
    updateButton.addEventListener('click', function() {
      document.getElementById('favDialog').showModal();
    });

    // Bouton pour fermer la boîte de dialogue
    cancelButton.addEventListener('click', function() {
      document.getElementById('favDialog').close();
    });

    // Bouton pour fermer la boîte de dialogue
    submitButton.addEventListener('click', function() {
      selectValue = document.getElementById('favAnimal').value;
			
			if(selectValue == ''){
				 selectValue = '........';
			}
			
			document.getElementById('resp').innerHTML = selectValue;
    });

  })();
              
            
!
999px

Console