File tree 3 files changed +33
-28
lines changed
3 files changed +33
-28
lines changed Original file line number Diff line number Diff line change @@ -22,12 +22,12 @@ <h2 class="greeting" id="greeting"></h2>
22
22
23
23
< div class ="accomplishInput ">
24
24
< form >
25
- < h3 > I am planning to accomplish< input type ="text " id ="goal "> today!</ h3 >
25
+ < h3 > I am planning to accomplish< input type ="text " id ="input "> today!</ h3 >
26
26
</ form >
27
27
</ div >
28
28
< div class ="toDo ">
29
- < ol id ="toDoList ">
30
- </ ol >
29
+ < ul id ="list ">
30
+ </ ul >
31
31
</ div >
32
32
< script src ="main.js "> </ script >
33
33
</ body >
Original file line number Diff line number Diff line change @@ -59,12 +59,8 @@ form {
59
59
margin-top : 120px ;
60
60
margin-bottom : -10px ;
61
61
}
62
- .accomplishInput {
63
- display : flex;
64
- justify-content : center;
65
- align-content : center;
66
- }
67
- # goal {
62
+
63
+ # input {
68
64
border : none;
69
65
border-bottom : 2px solid white;
70
66
background : none;
@@ -86,9 +82,18 @@ body {
86
82
87
83
li {
88
84
font-family : 'Open Sans' , sans-serif;
89
- text-align : left ;
85
+ text-align : center ;
90
86
font-size : 30px ;
91
87
list-style : none;
92
88
margin : 0 ;
93
89
color : white;
90
+ position : fixed;
94
91
}
92
+
93
+ .accomplishInput {
94
+ display : flex;
95
+ align-items : center;
96
+ justify-items : center;
97
+ flex-direction : column;
98
+ text-align : center;
99
+ }
Original file line number Diff line number Diff line change @@ -64,22 +64,22 @@ function checkTime(i) {
64
64
}
65
65
66
66
//TodoList
67
- function newList ( ) {
68
- var item = document . getElementById ( "goal" ) . value ;
69
- var ol = document . getElementById ( "toDoList" ) ;
70
- var li = document . createElement ( "li" ) ;
71
- li . appendChild ( document . createTextNode ( "- " + item ) ) ;
72
- ol . appendChild ( li ) ;
73
- document . getElementById ( "goal" ) . value = "" ;
74
- li . onclick = removeItem ;
67
+ function newItem ( ) {
68
+ var item = document . getElementById ( 'input' ) . value ;
69
+ var ul = document . getElementById ( "list" ) ;
70
+ var li = document . createElement ( 'li' ) ;
71
+ li . appendChild ( document . createTextNode ( "- " + item ) ) ;
72
+ ul . appendChild ( li ) ;
73
+ document . getElementById ( 'input' ) . value = "" ;
74
+ li . onclick = removeItem ;
75
+ }
76
+
77
+ document . body . onkeyup = function ( e ) {
78
+ if ( e . keyCode == 13 ) {
79
+ newItem ( ) ;
80
+ }
75
81
}
76
-
77
- document . body . onkeyup = function ( e ) {
78
- if ( e . keyCode == 13 ) {
79
- newList ( ) ;
80
- }
81
- } ;
82
-
83
- function removeItem ( e ) {
84
- e . target . parentElement . removeChild ( e . target ) ;
85
- }
82
+
83
+ function removeItem ( e ) {
84
+ e . target . parentElement . removeChild ( e . target ) ;
85
+ }
You can’t perform that action at this time.
0 commit comments