Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript

Search and data extractor Function

<tr>
   <td valign="top">
        <p>V172</p>
   </td>
   <td valign="top">
        <p> Combined transmission must contain valid. </p>
   </td>
    <td colspan="3" valign="top">
         <p> Invalid combination of forms in combined .</p>
    </td>
    <td valign="top"> </td>
    <td valign="top">
          <p>Y</p>
    </td>
</tr>

It's a table row sample in a HTML document. Where there are almost 150 plus similar row. I need to search the "V172" in whole documents. When function find the keystring in a td > p then function need to extract all other sibling td > p text, make a sentence and return as a string except keystring. output for above example should look like that.

Edit: Combined transmission must contain valid. </br> Error Message: Invalid combination of forms in combined . </br> Mand: Y

I need to pass an argument (var $titile = "V172") every-time in that function to extract different information again and again.