Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Good Example: Focus moved to AJAX content with tabindex="-1" after a delay

<p><button id="liveButton">Create announcement</button>
<span id="liveRegion" aria-live="assertive"></span></p>
<p><button id="liveButton">Create announcement</button></p>
<script>
$('#liveButton').click(function(){
  var live = $('#liveRegion');
  live.css({
    'display':'inline-block',
    'background-color':'#fff5bc',
    'padding':'0px 4px'
  }).text('Hooray for accessibility!');
  setTimeout(function(){ 
    live.text('');
    live.removeAttr('style');
  }, 3000);
});
</script>
Source by dequeuniversity.com #
 
PREVIOUS NEXT
Tagged: #Good #Focus #moved #AJAX #content #delay
ADD COMMENT
Topic
Name
1+8 =