2
I’m not gonna post code on the question because I don’t know the beginning. I have a page in HTML and with want to know if it is possible, with PHP invoke click action, etc, in selectors for example .classe#id
.
Example:
<body>
<button id='go'>Meu botão 1</button>
<button id='ex'>Meu botão 2</button>
</body>
In an external PHP it is possible to request the click on button#go
or button#ex
? If yes, how?
Immediate response: no. Click is a DOM event, and PHP, because it is a preprocessor, does not interact with the DOM after creating the page, as does Javascript, for example. It is possible with PHP to write a Javascript function to manipulate the DOM.
– Thiago Santos
You can even run some PHP code with Javascript (ajax).
– Hamurabi Araujo