Procházet zdrojové kódy

Move event handler to form, add input field (does not work yet)

Benoît Hubert před 8 roky
rodič
revize
f9951f2a70
2 změnil soubory, kde provedl 10 přidání a 1 odebrání
  1. 5 0
      css/styles.css
  2. 5 1
      index.html

+ 5 - 0
css/styles.css

@@ -15,4 +15,9 @@ button {
   color: white;
   border: none;
   border-radius: 3px;
+}
+input {
+  border: 1px solid #ddd;  
+  padding: 8px;
+  border-radius: 3px;
 }

+ 5 - 1
index.html

@@ -23,7 +23,11 @@
         <!-- Add your site or application content here -->
         <div class="container">
             <p>Hello world! This is HTML5 Boilerplate.</p>
-            <button onclick="sayHelloAgain()">Say hello again</button>
+            <p>Enter your name please:</p>
+            <form id="helloForm" onsubmit="sayHelloAgain()">
+                <input id="inputName" value="" />
+                <button type="submit">Say hello again</button>
+            </form>
         </div>
         <script src="js/vendor/modernizr-3.5.0.min.js"></script>
         <script src="https://code.jquery.com/jquery-3.2.1.min.js" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin="anonymous"></script>