开发者

Search raw text using jQuery

I want to search a text_word from raw text using jQuery.

$("#s:regex('text_word')").each(function() {
    $(this).appendTo('#s1');

});

<div id="s">raw text here</a>

<div id=开发者_运维百科"s1"></a>

Thanks Jean


Your request is not clear; if you need to filter your div by text you could try with:

<script type="text/javascript">
$(function() {
    $("div:contains('Text to search')").each(function(index) {
     alert(index + ': ' + $(this).text());
    });
});
</script>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜