mardi 27 mars 2018

How to select option Ember Javascript from web browser developer tools

I am trying to select a desired value from dropdown menu in browser developer tools with Javascript. The following picture shows the content of the page.

Web content

But whenever I select another value with code and then click the save button, the changes are not actually saved. When I select normally with my mouse and click the save button, it changes normally.

I have tried the following stuff. These seemingly changed the value of selected dropdown menu (it shows 2 when I write the code) but cannot be saved afterwards.

1- document.getElementById('channel24g_ctrl')[2].selected = true

2- document.getElementById('channel24g_ctrl').options.selectedIndex = 2

3- document.getElementById('channel24g_ctrl').options[2].selected = true

4- document.getElementById('channel24g_ctrl').options[2].click()

5- document.getElementById('channel24g_ctrl').options[2].setAttribute("selected", "selected"); document.getElementById('channel24g_ctrl').options[1].removeAttribute("selected");

I might have tried some other combinations of those above. Only the fifth actually makes target option "selected" but it still doesn't work when save button is clicked. I am no expert with javascript or ember but I have done similiar things before with other websites and succeeded. So maybe the problem is with Ember Framework?

What else can I do?




Aucun commentaire:

Enregistrer un commentaire