I have a php code that generates some <a>
tags and the final output looks like:
<div id='link1'>
<a style="font-size:10pt; color: #008056" href="somelink">Name</a>
<b>;</b>
</div>
My question is how can I count all of the semicolons in that div with jquery?
I don't know what you are up to, but if you need it, then you can do:
$('#link1').html().match(/;/g).length
/;/g
is the regex that will match all ;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With