Are there any text selector in jquery ?
My Code
Hello World! Hello World!
Reslut Should be (Using Jque
You can do a regex replacement, etc for your simple case, but for a more general answer: no.
jQuery just doesn't provide much help when dealing with text nodes, it's designed primarily for dealing with element node types (nodeType == 1
), not text node types (nodeType == 3
)...so yes you can use it where it helps (e.g. .contents() and .filter()), but that won't be often since it's not the library's main purpose.