Jquery to count words, img,videos and get duration?

Jquery to count words, img,videos and get duration?

Im doing a task that I need to go to a url with an article on it. Count words,img and videos in the main article only. PLUS get video duration. The article page is different every time so I need to first guess which tags are it. 

I was thinking the logic would be. Find content between each tag. Whichever innerhtml has the most characters in it thats the main article. So count words,img,and videos between those 2 tags. get video duration-i dunno. Is all this even possible?

  1. <p>ABC</p>
  2. <p>ABCDEF</p>
  3. <p>ASŞLDKASDA</p>
  4. <p>asdlkajsdmmlksadma</p>
  5. <p>aslkdjasldkjsaldkjasdlaksjdlak</p>

  6. <div id="result"></div>
  7. ----------------------------------------------------------------

  8. var $most = $("p").first();

  9. $("p").each(function(){
  10.     if($most != null && $(this).text().length > $most.text().length){
  11.         $most = $(this);
  12.     }
  13. });

  14. $most.addClass("longest");


JSFiddle

How can I use this to go through every tag? I tried using '*' and '*', 'body' but it changes css bg black for everything.