Jump to content

Recommended Posts

I dont know if this is ajax, but i need some help with javascript using jquery.

 

I. I have many images on page, and every one has some classes.

Now i would like that when i insert that class into input field and press enter, all images with that class stays, and other dissapears. We could say it is some kind of search.

 

For example:

 

<img src="1.png" class="design boobs" />

<img src="2.png" class="design tractor" />

<img src="3.png" class="other obama" />

<img src="4.png" class="other ipad" />

 

so if i for example insert design and press enter, only 1 and 2 stays or if i insert boobs only 1 stays and other dissapear.

 

EDIT: If there is possible i would also need an option to show all, and text if there werent any images found.

 

Thanks :)

-S

Link to comment
https://forums.phpfreaks.com/topic/231266-filter-help/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.