jquery: how can you select texts not surrounded by html tags?

后端 未结 7 2205
Beer

Vodka
rum
whiskey

how can you select beer ? or rum ? in jquery ? they are not surrounded by any html tags....

7条回答
  •  没有蜡笔的小新
    2021-01-18 16:30

    Well it has to be surrounded by something, even if it's just the tag. If you had a HTML document with just that written in it, I would think the browser would implicitly put a in the DOM for you.

    That being said, take a look at this:

    How do I select text nodes with jQuery?

提交回复
热议问题