You can do this with a little bit of jQuery
To take the ID and create your H3 text from that...
$(document).ready(function() {
$('h3').each(function() {
var newHeading = $(this).attr('id'); //Get the ID
newHeading = newHeading.replace('_', ' '); //Replace the _ with a space
$(this).text(newHeading); //Replace the H3 text with the new heading
});
});
...or to take the heading text and generate the ID from that...
$(document).ready(function() {
$('h3').each(function() {
var newID = $(this).text(); //Get the H3 text
newID = newID.replace(' ', '_'); //Replace spaces with _
$(this).attr('id', newID); //Attach the new ID
});
});
Of course, these both rely on the user having JS and for that reason, you should make sure you have a suitable fall-back for users with JS off