Difference between revisions of "Tabindex.js"

From Level Access Web Labs
Jump to navigation Jump to search
Line 8: Line 8:
 
  for (var i=0; i<el.length; i++) {
 
  for (var i=0; i<el.length; i++) {
 
s = document.createElement('Span');
 
s = document.createElement('Span');
t = document.createTextNode(" tabindex="+el.item(i).tabindex +" ");
+
t = document.createTextNode(" tabindex="+el.item(i).tabIndex +" ");
 
s.appendChild(t);
 
s.appendChild(t);
 
s.style.backgroundColor = 'antiqueWhite';
 
s.style.backgroundColor = 'antiqueWhite';

Revision as of 03:01, 9 February 2014

javascript:(function(){ var el = document.querySelectorAll('[tabindex]'); var str; var headers=[]; var sentinel;

if (el.length>0) {

	for (var i=0; i<el.length; i++) {

s = document.createElement('Span'); t = document.createTextNode(" tabindex="+el.item(i).tabIndex +" "); s.appendChild(t); s.style.backgroundColor = 'antiqueWhite'; s.style.color = 'black'; el.item(i).parentNode.insertBefore(s,el.item(i)); } } else { alert('no elements with tabindex'); }

})();