I have the following code:
<div class="accordion mobile ui-accordion ui-widget ui-helper-reset" role="tablist">
    <h3 class="accord-**19** **ui-state-active**"><span class="ui-accordion-header-icon ui-icon ui-icon-triangle-1-s">Title 1</h3>
        <div style="" class="ui-accordion-content ui-corner-bottom ui-helper-reset ui-widget-content ui-accordion-content-active" id="ui-id-2" aria-labelledby="ui-id-1" role="tabpanel" aria-hidden="false">
            Content for title 1
        </div>
        <h3 class="accord-41">Title 2</h3>
        <div style="display: none;" class="ui-accordion-content ui-corner-bottom ui-helper-reset ui-widget-content" id="ui-id-4" aria-labelledby="ui-id-3" role="tabpanel" aria-hidden="true">
            Content for title 2
        </div>
        <h3 class="accord-47">Title 3</h3>
        <div style="display: none;" class="ui-accordion-content ui-corner-bottom ui-helper-reset ui-widget-content" id="ui-id-6" aria-labelledby="ui-id-5" role="tabpanel" aria-hidden="true">
            Content for title 3
        </div>        
</div>

What I am trying to do is:

Get the h3 tag that contains the class ui-state-active
and then
Get the unique id  (in this example, 19) that comes after the class name that starts with "accord-".

Note, the above is churned out by a plugin I am using, which means I cannot set and "id" tag for h3 to be unique.
I have tried:
var classname = $("div.accordion h3.ui-state-active").find('class^="accord-"');
To get the name of the class, before I substring it.
However, this doesn't work.

How to find a specific class that contains another class?
When you tried to retrieve the class name .find  was not the correct way to do it. To find the attributes of an element you should use .attr, and then specify .attr("class") to find classes. Then from there use regex to find the correct accord-id.
var classname = $("div.accordion h3.ui-state-active").attr("class");
var id = classname.match(/accord-(\d+)/)[0];

