jQuery. Select all the elements that classname starts with
You're almost there:
// selects all that start with "ses_"
var sessions = $('[class^="ses_"]');
Even though your loop should work, you could also use the
sessions.each(function(index){
this.prepend(... // and so on
});
You can use the attribute starts with selector in jQuery: http://api.jquery.com/attribute-starts-with-selector/
Beware that it's not nearly as fast as using the regular way of selecting elements.