You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: assets/script/index.js
+25-1Lines changed: 25 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -4,4 +4,28 @@ var summary = document.querySelector('body > main > section#summary');
4
4
varbody=document.querySelector('body > main > section#body');
5
5
varfooter=document.querySelector('body > main > section#footer');
6
6
varsignificantChange=document.querySelector('body > main > section#significantChange');
7
-
varresult=document.querySelector('body > main > section#result');
7
+
varresult=document.querySelector('body > main > section#result');
8
+
9
+
10
+
for(letcheckBoxoftype.querySelectorAll('form > div > label > input')){
11
+
12
+
checkBox.onchange=function(){
13
+
14
+
if(this.value=='other'){
15
+
16
+
if(!type.querySelector('form > div > label[for="other"] > span > input')){
17
+
18
+
type.querySelector('form > div > label[for="other"] > span').innerHTML='<input type="text" name="otherType" pattern="[a-zA-Z]+" placeholder="Insert the new type" required>';
19
+
type.querySelector('form > div > label[for="other"] > span > input').focus();
20
+
21
+
}
22
+
23
+
}else{
24
+
25
+
type.querySelector('form > div > label[for="other"] > span').innerHTML="<strong>other</strong>: Doesn't fit any of the suggested types?";
0 commit comments