I got a .css file linked to my HTML file. And somewhere, as a basis to my question, I got this:
<div class="input_container">
Later on, with javascript, I can add a .error to activate some class changes.
inputControl.classList.add('error');
Changing the class="input_container" to <div class="input_container.error">
Perfect.
But now when I enter this page through a diffrent direction, I want/need PHP to add this .error aswell.
And the following (simplified) does not work.
$style = "input_container";
<div class=<? echo "\"".$style."\""; ?>>
<div class="<?= $style ?>">? Not sure what you were trying to do there with the quotes<?to start a PHP section. That will only work if you haveshort_open_tagenabled. Maybe that's the problem? We don't actually know what your question/problem really is. See: PHP tags.Changing the class="input_container" to <div class="input_container.error">...no, it changes it toinput_container error- no dot. Not the same thing.