Difference between revisions of "Title Attribute Favlet"

From Level Access Web Labs
Jump to navigation Jump to search
(Add link to "Install a Favlet")
 
(19 intermediate revisions by one other user not shown)
Line 1: Line 1:
 
This Favlet displays the text of all title attributes.
 
This Favlet displays the text of all title attributes.
  
<a href=”javascript:(function(){var%20element=document.createElement(‘script’);element.setAttribute(‘src’,'Title attribute.js’);document.body.appendChild(element);})();”> Title Attribute Favlet </a>
+
(See [[Install a Favlet]] for instructions on how to add this Favlet to your browser).
  
<h2> Sample code </h2>
+
<html>
<code>
+
<div style="padding-bottom:1em;">
<pre>
+
  <a href="javascript:(function(){var element=document.createElement('script'); element.setAttribute('src','https://mraccess77.github.io/favlets/title_attribute.js');document.body.appendChild(element);})();"> Title Attribute Favlet </a>
javascript:(function(){
+
</div>
var el = document.querySelectorAll('[title]');
+
<!-- <iframe style="width:100%;" src="https://github.com/mraccess77/mraccess77.github.io/blob/master/favlets/title_attribute.js">
var str;
+
</iframe> -->
var headers=[];
+
<a href="https://github.com/mraccess77/mraccess77.github.io/blob/master/favlets/title_attribute.js"> Source code to the title attribute favlet on github</a>
var sentinel;
+
</html>
if (el.length>0) {
 
for (var i=0; i<el.length; i++) {
 
s = document.createElement('Span');
 
t = document.createTextNode(" Title="+el.item(i).title +" ");
 
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 titles');
 
}
 
  
})();
+
[[Category:Favlet]]
</pre>
 
</code>
 

Latest revision as of 22:06, 6 November 2018

This Favlet displays the text of all title attributes.

(See Install a Favlet for instructions on how to add this Favlet to your browser).

Title Attribute Favlet

Source code to the title attribute favlet on github