Skip to content

Commit

Permalink
Include label in ARIA response.
Browse files Browse the repository at this point in the history
  • Loading branch information
joedolson committed May 23, 2016
1 parent 4267d6b commit 31edc31
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion comment-form-with-js-aria/js/comments.js
Expand Up @@ -36,7 +36,7 @@
var labelText = $(this).prev('label').html();
// add aria-describedby with reference ID for error message.
$(this).attr( 'aria-describedby', id );
$(this).parent().append( ' <span class="yourtheme-field-error" id="' + id + '">' + yourthemeComments.required + '</span>' );
$(this).parent().append( ' <span class="yourtheme-field-error" id="' + id + '">' + labelText + ': ' + yourthemeComments.required + '</span>' );
hasError = true;
}
if ( $(this).attr( 'name' ) == 'email' && $.trim( $(this).val() ) != '' ) {
Expand Down

0 comments on commit 31edc31

Please sign in to comment.