0

I would like to apply a numeric range on ends with (id$=) with jQuery but I couldn't. I tried:

[id$="[1-8]"]

My code:

<script>
  $(function() {
  $('[id^="text"][id$="[1-8]"]').css("color", "red");
});

</script>

<p id="text1">
  Column 1
</p>

<p id="text2">
  Column 2
</p>

Is there any way to get the range using just two numbers (1-8 for example) with jQuery only?

isherwood
  • 58,414
  • 16
  • 114
  • 157
neves
  • 796
  • 2
  • 10
  • 36

0 Answers0