Basic javascript dom parsing done as an assignment exercise.