Difference between revisions of "Title Attribute Favlet"

From Level Access Web Labs
Jump to navigation Jump to search
(Add link to "Install a Favlet")
 
(17 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.
 +
 +
(See [[Install a Favlet]] for instructions on how to add this Favlet to your browser).
  
 
<html>
 
<html>
<a href=”javascript:(function(){var%20element=document.createElement(‘script’);element.setAttribute(‘src’,'Title%20attribute.js’);document.body.appendChild(element);})();> Title Attribute Favlet </a>
+
<div style="padding-bottom:1em;">
 +
  <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>
 +
</div>
 +
<!-- <iframe style="width:100%;" src="https://github.com/mraccess77/mraccess77.github.io/blob/master/favlets/title_attribute.js">
 +
</iframe> -->
 +
<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>
 
</html>
 
</html>
  
<h2> Sample code </h2>
+
[[Category:Favlet]]
<code>
 
<pre>
 
javascript:(function(){
 
var el = document.querySelectorAll('[title]');
 
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(" 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');
 
}
 
 
 
})();
 
</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