标签:text indexof asc type red 天天向上 bsp javascrip item
<body>
<div id="content"> <span>好好学习</span> <span>天天向上</span> </div>
</body>
<script type="text/javascript"> $(document).ready(function(){ $("#content>span").each(function(index,item){ var str = $(item).text(); if(str.indexOf("好好学习")!=-1){ $(item).css("color","red"); } }); }) </script>
标签:text indexof asc type red 天天向上 bsp javascrip item
原文地址:https://www.cnblogs.com/mjtabu/p/11759785.html