filter a list by the class name
I want to filter a list by the class name in searchDIV . The $("#searchDIV *").filter works for searching everything but I want just the class name or really the name of <?php echo $partno ?>
Thanks for the help!
Travis
- <input id="searchInput" type="text" placeholder="Search..">
- <script>
- $(document).ready(function () {
- $("#searchInput").on("keyup", function () {
- var value = $(this).val().toLowerCase();
- $("#searchDIV *").filter(function () {
- $(this).toggle($(this).text().toLowerCase().indexOf(value) > -1)
- });
- });
- });
- </script>
- <?php
- while ($row = mysql_fetch_assoc($results)) {
- extract($row);
- ?>
- <div id="searchDIV" class="<?php echo $partno ?>">
- <a class="productByPartNo_select" href="<?php echo $webPage ?>#<?php echo $partno ?>" title="<?php echo $partno ?>">
- <div class="productByPartNo_wrapper center">
- <div class="productByPartNo_image"><img src="images/products/<?php echo $image ?>_thumb.jpg"/></img></div>
- <div class="productByPartNo_description_wrapper">
- <div class="product_partno"><h3><?php echo $partno ?></h3></div>
- <div class="product_title"><h4><?php echo $title ?></h4>
- </div>
- </div>
- </div></a>
- </div>
- <?php
- }
- ?>