Reputation: 14141
Is it ok to have a span tag within another span tag? I need to format the digits within a span tag with jquery.
<span id="tprice">The price is: $95</span>
Upvotes: 1
Views: 177
Reputation: 239280
Sure, you could even put a span tag within a span tag within a span tag ;).
This is actually pretty common and required in some instances such as when dealing with microformats/microdata.
Upvotes: 3
Reputation: 348992
Yes, it's OK. There's no rule which forbids, nor discourages this practice.
If that piece of HTML occurs more than once, replace id="tprice"
by class="tprice"
, because the ID must only occur once.
Upvotes: 3