我試圖提取兩句了一堆段落,而我堅持......基本上,段落是這樣的:如何用jQuery提取單個句子?
<p class="some_paragraph">This is a sentence. Here comes another sentence. A third sentence.</p>
<p class="some_paragraph">Another sentence here. Interesting information. Very interesting.</p>
<p class="some_paragraph">This is a sentence. Here comes another sentence. A third sentence.</p>
我需要做的,就是找兩個'這三段中所有9個句子中最短的句子。兩個提取的句子必須放入以下跨度:
<span class="span1">Shortest sentence comes here</span>
<span class="span2">Second shortest sentence comes here</span>
我該怎麼做?
這只是一個基本的想法 –
似乎不起作用http://jsfiddle.net/mVrf你/我錯過了什麼? –
你錯過了jquery =)) –