Andrew Nevins
(@anevins)
WCLDN 2018 Contributor | Volunteer support
ARIA should be added via JavaScript.
- Download this plugin: https://ww.wp.xz.cn/plugins/custom-css-js-php/
-
Go to the “Add New JAVASCRIPT” area (screenshot)
- Add the JS to target the textarea
// Example
jquery(document).ready(function($) {
$('textarea').attr('role', 'textbox');
});
- Save
Thread Starter
bloppy
(@bloppy)
Thanks for your reply but I want to avoid that kind of hack.
I want that enhancement to be native in the code.
There’s really no reason to add role=”textbox” on a textarea; a textarea natively already has that role, along with all of the other ARIA attributes you’re describing. The only reason to use these ARIA attributes would be if you were using an alternate format (such as div), and needed it to be recognized as a textfield by screen readers. Adding redundant roles and attributes doesn’t actually accomplish anything.
Thread Starter
bloppy
(@bloppy)