소스 검색

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

Benoît Hubert 8 년 전
부모
커밋
f9951f2a70
2개의 변경된 파일10개의 추가작업 그리고 1개의 파일을 삭제
  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>