0
I have a product gallery and the side there are some buttons that are the categories of these products (buttons: cabinet, monitors, mouse, chairs, etc), when I click in this category, a toggle active only products of that specific category.
However, I want above these products to contain a title that will initially look like this: "Products" (this is the default), but when I click on the Cabinet category, for example, this title will be changed to "Cabinets". I could tell?
Well, I want that to happen with all the other buttons always changing the title at runtime.
I even tried to create a function
by clicking using GetElementById
along with a IF ELSE
, but it applies the first validation only.
Someone who’s done something like this could help me?
Important: I’m picking up the buttons from the database, simply I did an instruction WHILE
that will repeat the buttons according to the number of categories registered in the database, so it does not have so right away, as add a different function for each button. There’s a way, but not so easily.
You are using jquery?
– Marcelo Shiniti Uchimura
Ask the question the code you made to look at what might be wrong.
– Woss
Welcome, important to read this post to get success on your next questions https://answall.com/help/mcve. and to mark an answer as it accepts https://i.stack.Imgur.com/evLUR.png and why it accepts https://pt.meta.stackoverflow.com/questions/1078/comor-e-why-what-to-accept-a-reply/1079#1079
– user60252
Hello @Marcelouchimura! I’m not using jQuery.
– Lougans de Matos
@Andersoncarloswoss So, since it’s a problem of a client’s website, my manager didn’t allow me to divulge part of the code, but the friends below answered according to the descriptive that I gave and worked, but in future questions, I’ll try to post the code Grateful!!
– Lougans de Matos