Thanks to John's lead and results from a more appropriate search term, I found this:
Javascript: Detect Carets Parent Node
To answer the question, here's how it's done.
function getCursorParentNode()
{
var target = null;
if(window.getSelection)
{
target = window.getSelection().getRangeAt(0).commonAncestorContainer;
return((target.nodeType===1) ? target : target.parentNode);
}
else if(document.selection)
{
var target = document.selection.createRange().parentElement();
}
return target;
}
Then, initialize it however you prefer, for example:
$('.content').on('keydown',function(){
var target = getCursorParentNode();
target.className = 'red';
});