There is a javascript code with a variable that contains the result, depending on it I want to output a part of the code (HTML + PHP). Thinking, I came to the conclusion that you need to somehow transfer the variable from js to php, which would then make the if else conditions in PHP and output what you need. Since it is more convenient to do this with PHP, for example, you can do so
<? if(1=1) { ?> Сдесь любой код <? } ?> On js, I have not yet figured out how to do this. I think it is possible to do this using Ajax, but if there is any other simpler and more suitable way, I will be glad to know.