table里有个隐藏的span,怎么获取不到?

https://img.mukewang.com/5c4970150001d15f08000372.jpg

能看到这个span被隐藏了

https://img1.mukewang.com/5c49701c0001f5a507160258.jpg

但是我用jquery却得不到值,怎么弄:X


跃然一笑
浏览 461回答 1
1回答

陪伴而非守候

由于不合法,span被提到table外面了。你用chrome element查看就能发现,比如下面的dom<table>&nbsp; &nbsp; &nbsp; &nbsp; <tbody>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <tr>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <td>1</td>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <td>2</td>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <td>3</td>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <td>4</td>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span>aaaa</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span>aaaa</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span>aaaa</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </tr>&nbsp; &nbsp; &nbsp; &nbsp; </tbody>&nbsp; &nbsp; </table>实际上变成了
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript