0

Suppose I have this webpage. I would like to pass a JS command to in the console to select "All languages".

enter image description here

The button is an input with onchange="widgetEvCall('handlers.updateFilter', event, this);

This is the complete chunk of html for the botton:

<input id="filters_detail_language_filterLang_ALL" type="radio" name="filters_detail_language_filterLang_0" value="ALL" onchange="widgetEvCall('handlers.updateFilter', event, this);">

I would like to use the handlers.updateFilter function to pass the id of the filter I want to select (id="filters_detail_language_filterLang_ALL") and "simulate" that the button is clicked runnig handlers.updateFilter in the chrome console.

Dambo
  • 3,318
  • 5
  • 30
  • 79
  • 3
    Perhaps not an exact duplicate, but the answers to this question should also answer yours: https://stackoverflow.com/questions/155188/trigger-a-button-click-with-javascript-on-the-enter-key-in-a-text-box – Daniel Beck Mar 05 '18 at 01:07
  • thanks `document.getElementById("filters_detail_language_filterLang_ALL").click()` worked – Dambo Mar 05 '18 at 01:12

0 Answers0