How do I insert a string into an empty font tag?

how to add a line to an empty font tag? For example, if there is no value in the second font tag, I'll just add the tag <br />

. How can i do this?

I have this HTML code:

<P ALIGN="LEFT">
    <FONT FACE="Verdana" style="font-size:10" COLOR="#0B333C" LETTERSPACING="0" KERNING="0">
        Welcome to jQuery Course
    </FONT>
</P>
<P ALIGN="LEFT">
    <FONT FACE="Verdana" style="font-size:10" COLOR="#0B333C" LETTERSPACING="0" KERNING="0">
    </FONT>
</P>
<P ALIGN="LEFT">
    <FONT FACE="Verdana" style="font-size:10" COLOR="#0B333C" LETTERSPACING="0" KERNING="0">
        This is the jQuery Introduction content.
    </FONT>
</P>

      

And I like the conclusion:

<P ALIGN="LEFT">
        <FONT FACE="Verdana" style="font-size:10" COLOR="#0B333C" LETTERSPACING="0" KERNING="0">
            Welcome to jQuery Course
        </FONT>
    </P>
    <P ALIGN="LEFT">
        <FONT FACE="Verdana" style="font-size:10" COLOR="#0B333C" LETTERSPACING="0" KERNING="0">
            <br />
        </FONT>
    </P>
    <P ALIGN="LEFT">
        <FONT FACE="Verdana" style="font-size:10" COLOR="#0B333C" LETTERSPACING="0" KERNING="0">
            This is the jQuery Introduction content.
        </FONT>
    </P>

      

+1


a source to share


2 answers


You cannot use a font tag.

You can

str_replace("></FONT>", ">$myinserttext</FONT>", $myhtml);

      



in PHP or

$("font:empty").html("Sample Content");

      

in jQuery.

+5


a source


sort of



$("font:empty").html("My string");

or append:

$("font:empty").append("My string");

      

0


a source







All Articles