I need to loop through some elements in the page and then, for each one, if it had a class beginning with, for example, \"C\", do something.
$(\'#dialog li\').e
Try something like $('#dialog li[class^="C"]')
$('#dialog li[class^="C"]')