MCPcopy Create free account
hub / github.com/Vishal-raj-1/Awesome-JavaScript-Projects / webstudent

Function webstudent

assets/js/WebDevelopmentCourse.js:29–63  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

27
28}
29function webstudent()
30{ var t=document.getElementById('table2');
31 if( document.getElementsByClassName("student")[0].textContent==="Generate Data Student"){
32 var webstudent={
33 student:[]
34}
35webstudent.student.push({'name':'Ritik Gupta','batch':'A2','RollNo':'2K19/SE/99','CGPA':'7.2'})
36webstudent.student.push({'name':'Riya Bansal','batch':'A2','RollNo':'2K19/SE/101','CGPA':'7.9'})
37webstudent.student.push({'name':'Abheek Kaushal','batch':'A5','RollNo':'2K20/CO/97','CGPA':' '})
38webstudent.student.push({'name':'Harshit Aggarwal','batch':'A5','RollNo':'2K19/CO/97','CGPA':'8.5'})
39webstudent.student.push({'name':'Deepanshu Tamta','batch':'A2','RollNo':'2K19/SE/99','CGPA':'7.2'})
40webstudent.student.push({'name':'Kushagra Kesarwani','batch':'A2','RollNo':'2K19/IT/101','CGPA':'8.2'})
41webstudent.student.push({'name':'Naveen Yadav','batch':'A5','RollNo':'2K19/IT/97','CGPA':'7'})
42webstudent.student.push({'name':'Rishav Sinha','batch':'A6','RollNo':'2K19/CO/97','CGPA':'8.5'})
43webstudent.student.push({'name':'Sohil Khan','batch':'A5','RollNo':'2K19/CO/97','CGPA':'8.5'})
44webstudent.student.push({'name':'Shashank Negi','batch':'A5','RollNo':'2K19/CO/97','CGPA':'8.5'})
45webstudent.student.push({'name':'Abhishek Kashyap','batch':'A5','RollNo':'2K19/CO/97','CGPA':'8.5'})
46webstudent.student.push({'name':'Yash Prasad','batch':'A5','RollNo':'2K19/CO/97','CGPA':'8.5'})
47
48for(var i=0;i<webstudent.student.length;++i){
49 t.innerHTML+='<tr><td>'+webstudent.student[i].name+'</td>'+'<td>'+webstudent.student[i].batch+'</td>'+'<td>'+webstudent.student[i].RollNo+'</td><td>'+webstudent.student[i].CGPA+'</td></tr>' }
50t.disabled=true;
51document.getElementsByClassName("student")[0].textContent="hide data";
52}else{
53 for(let i=0;i<=12;i++)
54 {if(i!=0)
55 {t.innerHTML=" ";
56}
57 t.innerHTML='<tr><td>'+"Name"+'</td>'+'<td>'+"Batch"+'</td>'+'<td>'+"RollNo"+'</td><td>'+"CGPA"+'</td></tr>'
58
59
60} document.getElementsByClassName("student")[0].textContent="Generate Data Student";
61}
62
63}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected