Created
March 21, 2023 10:31
-
-
Save kartick14/c645aac4f1149509f10113d51b79ae61 to your computer and use it in GitHub Desktop.
Filter Image depends on alt tag value
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const $img = jQuery(".product__media-list img"); | |
jQuery(".color_input_fields input").on("click",function() { | |
$img.parents('li').hide(); | |
const val = this.value.trim().toLowerCase(); | |
if (val === "") return; | |
$img.filter(function() { return this.alt.toLowerCase().includes(val) }).parents('li').show() | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment