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>
精彩评论