A common functionality is to search for elements in a Web page. Using the same organisation as in the previous exercise (you can just copy the files and adapt them), create:
input
fields, one for searching for students, and another one
for searching for modules
input
field so that, when the name
of a student is entered is this field, only the corresponding student will
be displayed on the Web page (if several students have the same name they will
all be displayed)
Note that the elements will need to have an appropriate
id
and/or a class
property to make possible
to retreive them easily.
Tips:
display
property makes its possible to display an element or not
getElementById()
allows retreiving an element in a HTML page
(so as getElementsByClassName()
except it returns an array of elements)
search()
searches a string in another string