Я знаю, что вы уже приняли ответ, но в любом случае ...
Вот, на мой взгляд, лучшее решение.
Почему это так?
Только 3 строки кода, без использования регулярных выражений или частичных имен классов ...
См. Комментарии в моем коде для получения более подробной информации:
// You could use class^=[as-] to filter on the classes that start with as-,
// (the ^ would be better than a *, because more specific)
// But I suggest you to use the 'share-toggle' class, there's no need to complicate things here:
$('.share-toggle').on('click', function(){
// The following will get the .audio-share element that is after the element we just clicked,
// If your HTML structure is gonna stay well structured like this, it's the finest solution:
$(this).next('.audio-share').slideToggle('fast');
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="share-toggle as-1">[ CLICK HERE ]</div>
<div class="audio-share as1">
<p>Some Text</p>
</div>
<div class="share-toggle as-2">[ CLICK HERE ]</div>
<div class="audio-share as2">
<p>Some Text</p>
</div>
Я надеюсь, что вы рассмотрите этот ответ.
И я надеюсь, что это поможет!