3
Hello,
I would like to know if it is possible to select a class/element from a partially informed value, for example:
<div class="chart-piso c100 p100 orange big">
<span id="percPiso">100%</span>
<div class="slice">
<div class="bar"></div>
<div class="fill"></div>
</div>
</div>
I would like to select the elements only by stating that the classes contain the p
before the numbers because those numbers are variable.
I tried to select them this way and I know it’s super wrong too haha:
$("div[class*='chart-']").removeClass(div[class*='p']);
Any suggestions?
Thank you!
is in fact the type of search I need @Pedrocamarajunior, but I’m not able to put fit my code, follow how I tried to do:
$("div[class^='chart-']").removeClass("div[class^='p']");
– João Vitor
I think I get it, you need to select the
div
which contains the classchart-piso
and remove from thatdiv
the classp100
. That’s it?– Pedro Camara Junior
@Pedrocamarajunior that contains only "Chart-" because
piso
is variable and always remove the div that contains a class started withp
– João Vitor
Yes, I understood, it was just to use your example with example. But problem solved, I removed my closing vote. :)
– Pedro Camara Junior