I'm trying to create a chrome extension that clicks a button on a website using the DOM.click() method. (<https://www.w3schools.com/jsref/met_html_click.asp>)

EDIT: The purpose of this chrome extension is to create a keyboard shortcut to toggle on/off English Subtitles while watching a foreign language video. Having to use your mouse and dragging it to open a menu to turn on subtitles when you need them can be inconvenient if you are trying to understand the language without the subtitles. I wanted to create a keyboard shortcut that would immediately turn on the subtitles. An example of such a website is 
(<https://www.ondemandkorea.com/ask-us-anything-e102.html>) 

```
<button type="button" class="jw-reset jw-settings-content-item" role="menuitemradio" aria-checked="false">English</button>

```

This is button on the website I'm trying to click with Javascript

In my code, I have a window listener that waits for the specific website to load. Then, to find the button I want to click, I call *document.getElementsByClassName("Class Name")* and look through the returned elements array for a button that that says *English* and save it into *var englishButton*. I add another listener that listens for a keyboard key to be pressed which in turn presses *englishButton*.

However, when I click the shortcutKey, *englishButton.click();* doesn't seem to do anything. I know that the correct English Button is found and that my shortcutKey Listener works through the use of *console.log()* statements.

I can't seem to understand why the button won't click.

EDIT: After adding a buttonListener to the code, the English button does click after all, but it does not turn on the subtitles for the video

Here's my code.

```
  /*
Looking for the subtitle button that states "English"
*/
var englishButton;
window.addEventListener("load", function(event) {

    var buttonList = document.getElementsByClassName('jw-reset jw-settings-content-item');

    for (var i = 0, len = buttonList.length; i < len; i++){
        if(buttonList[i].textContent === "English") {
          englishButton = buttonList[i];
          break;
        }

    }
    englishButton.addEventListener('click', function() {
      console.log('englishButton clicked!');
    });

    /*
    Event Listener that detects when the shortcut key is hit.
    When the shortcut Key is hit. It will simulate a mouse click on the subtitle button
    */

    document.addEventListener('keyup', function(e){
        if(e.key === shortcutKey){
          console.log('shortcut pressed')
          englishButton.click();
        }
      }
    );

});

```