I am new to stackoverflow and jQuery in general, so I am having small issues with a simple function.
I have a random number of links on my website with id "filtro" + "some number" , and I want to write only one code for the click action in any of them (which will later affect the class with the same "filtrate" + " some number ").
For example: Click "# filterro3", do something on ".filtro3".
The problem is that I donβt know how to write a string in jQuery for "any number". I am thinking of doing something like this:
$(function () { $("#" + "filtro" + SOME NUMBER).click(function () {
Any ideas? Thanks!
Ps: This is my first question, and I apologize if I made any mistakes.
solvable. The dystroy solution worked like a charm.
In the future, referring to others, I will make this code to create a simple filter menu for the image gallery . Thus, I could hide / show photos of certain topics.
javascript jquery string jquery-selectors
Fernanda nia ferreira
source share