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

后端 未结 7 2146
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 <body> tag. If you had a HTML document with just that written in it, I would think the browser would implicitly put a <body> in the DOM for you.

    That being said, take a look at this:

    How do I select text nodes with jQuery?

    0 讨论(0)
提交回复
热议问题