Question: I am trying to make a very simple java script quiz to try and learn the language.

```
var result = document.getElementById("result");

var rightAnswer = document.getElementById("correct").addEventListener("click",correctAnswer);

function correctAnswer(){
 result.innerText="Correct";
};

var wrongAnswer = document.getElementsByClassName("wrong").addEventListener("click",wrongAnswer);

function wrongAnswer(){
 result.innerText="Wrong";
};

```

When I run it and test the correct answer works fine but the wrong answers are unresponsive. When I look in the console it says that "document.getElementsByClassName(...).addEventListener is not a function" which confuses me seeing how I formatted it exactly like the other line with the exception of the "getElementsByClassName". Can I not add the same event listener to multiple buttons of the same class? 
HTML

```
<!DOCTYPE html>
<html>

<head>
<title>Quiz</title>

</head>

<body>
<p>Who was the first president of the United States?</p>

<button class='button wrong' type='button'>Thomas Jefferson</button>

<button class='button' id='correct' type='button'>George Washington</button>

<button class='button wrong' type='button'>James Madison</button>

<button class='button wrong' type='button'>John F Kennedy</button>

<p id='result'></p>

<script src='quiz.js'></script>

</body>

</html>

```

Answer: 
The timeout operator is used to throw an error after a certain time has passed, thus killing the Observable. This is not the desired outcome for your case, if I understood your question correctly.

If indeed all you want is to notify the user twice - after 5, and 10 seconds, I would use an interval Observable, with an interval of 5 seconds, that will start at the same time as the http request. This Observable will terminate either when the request is finished, or when 2 emissions are fired (since you wanted only 2 notifications).

```
const httpRequest$ = Observable.fromPromise(SendHTTPRequest)
    .share();

const interval$ = Observable.interval(5000)
    .takeUntil(httpRequest$)
    .take(2)
    .map(x => (x + 1) * 5)
    .subscribe(seconds => console.log("It's been " + seconds + " seconds"));

httpRequest$.subscribe(response => doSomethingWithResponse(response));

```
```
import { of,interval } from 'rxjs';
import { groupBy, mergeMap, toArray, map,merge, reduce, concatMap, delay, concat, timeout, catchError, take } from 'rxjs/operators';

const obs$ = of('coucou');
const obs2$ = interval(5000).pipe(take(1), map(() => of('hello')));
const obs3$ = interval(5000).pipe(take(1), map(() => of('world'))); 

const result$ = obs$.pipe(concat(obs2$.pipe(concat(obs3$)))); 
const subscribe = result$.subscribe(val => console.log(val + ' ' + new Date().toLocaleTimeString()));  

```

Will print:

```
coucou 20:10:15
[object Object] 20:10:20
[object Object] 20:10:25

```