File tree Expand file tree Collapse file tree 1 file changed +41
-0
lines changed
Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Original file line number Diff line number Diff line change 1+ <!DOCTYPE html>
2+ < html lang ="en ">
3+ < head >
4+ < meta charset ="UTF-8 ">
5+ < meta name ="viewport " content ="width=device-width, initial-scale=1.0 ">
6+ < title > Document</ title >
7+ < script >
8+
9+ function add_data ( ) {
10+ size = prompt ( "Enter Food Size .... " ) ;
11+ data = [ ]
12+
13+ for ( let index = 0 ; index < size ; index ++ ) {
14+
15+ data . push ( prompt ( "Enter Food Name .... " ) ) ;
16+
17+ }
18+
19+ p_data = document . getElementById ( "print_data" ) ;
20+
21+ for ( let index = 0 ; index < data . length ; index ++ ) {
22+
23+ // print all elements
24+ p_data . innerHTML += "<li>" + data [ index ] + "</li>" ;
25+
26+ }
27+
28+
29+
30+ }
31+ </ script >
32+ </ head >
33+ < body >
34+
35+ < button onclick ="add_data() "> Add Record</ button >
36+
37+ < ul id ="print_data ">
38+
39+ </ ul >
40+ </ body >
41+ </ html >
You can’t perform that action at this time.
0 commit comments