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

Don't understand how my plugin isn't searching through my html to find an image through title value?

<div class="col">
         <input  id="listsearchinput" type="text"  >
        <ul id="listdata" class="list-group">
            <li class="gallery"><a class="group3 gallery" href="photos/01.jpg" title="I love hay bales. Took this snap on a drive through the countryside past some straw fields." ><p>Hay Bales</p> <p>. Took this snap on a drive through the countryside past some straw fields.</p><img src="photos/thumbnails/01.jpg" alt="" ></a></li>
            <li class="gallery"><a class="group3" href="photos/02.jpg" title="The lake was so calm today. We had a great view of the snow on the mountains from here."><p>Lake</p><p>The lake was so calm today. We had a great view of the snow on the mountains from here.</p><img src="photos/thumbnails/02.jpg" alt="" ></a></li>
            <li class="gallery"><a class="group3 gallery" href="photos/03.jpg" title="I hiked to the top of the mountain and got this picture of the canyon and trees below."><p>Canyon</p><p>I hiked to the top of the mountain and got this picture of the canyon and trees below.</p><img src="photos/thumbnails/03.jpg" alt=""></a></li>
            <li class="gallery"><a class="group3" href="photos/04.jpg" title="It was amazing to see an iceberg up close, it was so cold but didn’t snow today."><p>Iceberg</p><p>It was amazing to see an iceberg up close, it was so cold but didn’t snow today.</p><img src="photos/thumbnails/04.jpg" alt=""></a></li>
            <li class="gallery"><a class="group3" href="photos/05.jpg" title="The red cliffs were beautiful. It was really hot in the desert but we did a lot of walking through the canyons."><p>Desert</p><p> were beautiful. It was really hot in the desert but we did a lot of walking through the canyons.</p><img src="photos/thumbnails/05.jpg" alt=""></a></li>
            <li class="gallery"><a class="group3" href="photos/06.jpg" title="Fall is coming, I love when the leaves on the trees start to change color."><p>Fall</p><p>Fall is coming, I love when the leaves on the trees start to change color.</p><img src="photos/thumbnails/06.jpg" alt="bryant "></a></li>
            <li class="gallery"><a class="group3" href="photos/07.jpg" title="I drove past this plantation yesterday, everything is so green!" type="text/html"><p>Plantation</p><p></p><img src="photos/thumbnails/07.jpg" alt=""></a></li>
            <li class="gallery"><a class="group3" href="photos/08.jpg" title="My summer vacation to the Oregon Coast. I love the sandy dunes!"><p>Dunes</p><p>My summer vacation to the Oregon Coast. I love the sandy dunes!</p><img src="photos/thumbnails/08.jpg" alt=""></a></li>
            <li class="gallery"><a class="group3" href="photos/09.jpg" title="We enjoyed a quiet stroll down this countryside lane. 
            "><p>Countryside Lane</p><p>We enjoyed a quiet stroll down this countryside lane.</p><img src="photos/thumbnails/09.jpg" alt=""></a></li>
            <li class="gallery"><a class="group3" href="photos/10.jpg" title="Sunset at the coast! The sky turned a lovely shade of orange.
            "><p>Sunset</p><p>Sunset at the coast! The sky turned a lovely shade of orange.</p><img src="photos/thumbnails/10.jpg" alt=""></a></li>
            <li class="gallery"><a class="group3" href="photos/11.jpg" title="I did a tour of a cave today and the view of the landscape below was breathtaking."><p>Cave</p><p>I did a tour of a cave today and the view of the landscape below was breathtaking.</p><img src="photos/thumbnails/11.jpg" alt=""></a></li>
            <li class="gallery"><a class="group3" href="photos/12.jpg" title="I walked through this meadow of bluebells and got a good view of the snow on the mountain before the fog came in."><p>Bluebells</p><p>I walked through this meadow of bluebells and got a good view of the snow on the mountain before the fog came in.</p><img src="photos/thumbnails/12.jpg" alt=""></a></li>
        </ul>
        </div>
        </div>
        <script> 
            $("#listdata").searcher({
                itemSelector: "a[title]" ,
                textSelector: "",
                inputSelector: "#listsearchinput"
            });
        </script>

1 Answer

That's going to depend greatly on the specifics of the plugin you're using. Since the text you're searching on is in an attribute of an element, not the text of it, you should focus on that when looking through the plugin's documentation.