My question is about the following. Now I have this in a .php file:
<div class="uno">
<?php if( function_exists('number') ) { number('tres'); ?>
</div>
The PHP code that is in the middle generates a <div class="tres">
, like this:
<div class="uno">
<div class="tres"></div>
</div>
Well, what I'm looking for is: if the <div class="tres">
is generated, that it is wrapped with another <div>
with a CSS class. The result should be this:
<div class="uno">
<div class="dos"> ← La "envoltura" que necesito
<div class="tres"></div>
</div>
</div>
I can not put the <div class="dos">
directly in my .php file, so I need it to appear only if it's <div class="tres">
.
Can this be done with JavaScript? How?