<p>
02 <span>span test</span>
03 <a href=""></a>
04 <img src="test.jpg" />
05 </p>
06
07 假如你已經獲取到p為當前的this對象,怎麼去獲取span, a, img等子元素呢?
08 其實很簡單:
09
10 $(this).children("span")
11 $(this).children("a")
12 $(this).children("img")
剛開始接觸的同學可能會這樣寫$(this “a “)之類,這樣語法會報錯
摘自:https://lok.me/2011/08/jquery-get-this-children-object/