Wikipedia Viewer: Window not opening on 'click' event for random article

Hi All!

In the wikipedia viewer exercise, new window won’t open when I click “View Random Wikipedia Article”.

Instead, it opens as soon as I hit run (something I don’t want it to do), but then never works when I click the button.

What am I doing wrong?

Here is a link to my codepen:


You can do this

$(document).ready(function () {

or just a plain a href

<a href="" target="_blank">Random Stuff</a>
1 Like