在这里,如果我在浏览器上选择了一些 3 或 4 行,那么我想要浏览器上的选择编号,即选择的计数 <span>
我有一个 example.html,其中包含以下代码,
<div id="p">
<p id="p1">
<span>wefwef wefwefsdfc fcsdcs wefwscsdc qwefwcsdc </span>
<span>wefwec acvsdc wecfsdc <br />asdcsdc sdcdc wedwed</span>
<span> wefwec acvsdc wecfsdc asdcsdc sdcdc</span>
<span> wefwec acvsdc wecfsdc<br /> asdcsdc sdcdc</span>
<span>wefwec acvsdc wecfsdc asdcsdc sdcdc</span>
</p>
<p>
<span>wefwef wefwefsdfc fcsdcs wefwscsdc qwefwcsdc </span>
<span>wefwec acvsdc wecfsdc <br />asdcsdc sdcdc wedwed</span>
<span> wefwec acvsdc wecfsdc asdcsdc sdcdc</span>
<span> wefwec acvsdc wecfsdc<br /> asdcsdc sdcdc</span>
</p>
</div>
我有以下问题:
- 如何计算选中
<span>
? - 我将如何获得选择
<span>
?