0
Good morning! I have a problem that I need to make more than 1000 changes to some web pages, and I wanted to automate this. My idea was to do this via JS. I searched through the web and found the example document.getElementById("myButtonId").click();
but the button in question does not have ID
and has a property I’ve never seen (that editor-command
). How can I do that?
<li editor-command="insertoptions">
<span class="KB_Editor_Bdr_div Insert_Type" orgtitle="Insert options">Insert
<svg>
<use xlink:href="#KBEditortools_block_down_arrow"></use>
</svg>
</span>
</li>
The button in question:
document.querySelector('[editor-command="insertoptions"]')
. You can use this way to select by attribute, but I don’t know if this is what you need... Oonclick
is in thisli
?– Rafael Tavares
I deleted my comments because with the information you gave me I managed to solve, thank you very much! Do you have any link where I can understand how this querySelector works to learn more?
– Vitor Ceolin
The above question has an answer with the link to MDN documentation
– Rafael Tavares