How in PHP to set the value of HTML element by id or class?

Hello!
Doing a little project in Wordpress using Gantry 5.
I want to display values sent by the form at a certain place on the page.
In the particles of the Gantry directly it can be done. But you can write something in php in a separate template for my page.
The question is - how can I set a value to the element by id or class?
Using JS to understand and knowledge of php is not enough.
August 19th 19 at 23:34
1 answer
August 19th 19 at 23:36
Very not very clear what You need. Apparently some manipulations with the DOM, but then the question is, why php? And if so, then at least the example code.
If the question is how to display some data from the submitted form, like this:
echo $_POST['someMyData'];
and paste it in "a certain place"
thank you, Maxim, but I can't in the right place to use a php page was created on the Gantry, it uses "Parts" from which to create the content on the page. In these parts I can only use html and WP shortcodes, so echo $_POST['someMyData'] not good =(
So I thought maybe I can do something like echo(Velements-ั‚ะพ_ID)$_POST['someMyData']; - amelia_Williams commented on August 19th 19 at 23:39
php doesn't work. Ready manipulation of the dom via js. At the same old can withdraw using php as a hidden field or create a js script in the php that would work at boot and will do what is necessary. - lauryn9 commented on August 19th 19 at 23:42
: I'm not familiar with gantry, but throwing him a quick look, I think there are methods to do it it means. Smoke docks. - lauryn9 commented on August 19th 19 at 23:45
> echo $_POST['someMyData'];
1. Never trust data in GET/POST, they should always be check and clean
2. Never send on the output data of an unknown format without escaping - tessie.Mante commented on August 19th 19 at 23:48

Find more questions by tags HTMLPHPWordPress