I was wondering if this was possible:
I have a set of divs, each with an ID ending in '_font', e.g 'body_font', 'heading_font', 'tagline_font', etc.
Is there a way to grab those elements by searching for a common portion of their names, in this case '_font' so I can later manipulate them using jQuery?
You can use an "attribute ends-with" selector:
var elems = $("div[id$='_font']");
If you spend some time browsing the jQuery API you should be able to answer questions like this yourself without having to post on Stack Overflow.
Other selectors that might come in useful:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With