开发者

Search raw text using jQuery

开发者 https://www.devze.com 2022-12-24 17:02 出处:网络
I want to search a text_word from raw text using jQuery. $(\"#s:regex(\'text_word\')\").each(function() {

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

精彩评论

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