javascript - How to check if css class is missing in SVG? -


i'm using dynamic class show list of svg icons. need display sample image if css class ("icon") missing. how can this?

     <svg class="icon${id} icon${id}-dims" preserveaspectratio="xmidymid meet"  width="40px" height="40px"></svg> 

note: id variable use make svg classes dynamic. need know when there no matching classes available in css. have around 4000 icon classes.

you can check also..

if(($('#test').attr('class')).indexof("icon$") < 0) {   }