First example in plain JS

1st example