<div id='QuestionText'>
<p>This is a simple example </p>
<span> I am asking the question </span>
</div>
我得到div的HTML內容在下面的行如何檢查是否選擇存在於跨度或不jQuery的
VAR existing_lesson = $( '#QuestionText')。HTML ();
我得到了 '問題' 作爲我在下面一行
VAR getselectedarea = $ .selection()選擇;
現在我想要找的選擇是否是存在於span元素或者不意味着如果我選擇simple example
爲我的選擇,我應該得到,這是存在於HTML標籤,如果我選擇the question
我的選擇我應該知道它存在於哪個html標籤中。
爲什麼在這種情況下不使用「:contains」語句?性能問題? – cubitouch