-1

Is there a way to get class name starting with class something as below:

$('#div:visible').attr('[class^=qest]')
Navin Rauniyar
  • 10,127
  • 14
  • 45
  • 68

1 Answers1

0

Use jquery attribute selector like this.

$('[class^=qest]').each(function() {
    alert($(this).attr("class"));
});

This will get all the elements with class name starts with 'qest' and then loop through each element.

Anoop Joshi P
  • 25,373
  • 8
  • 32
  • 53