Difference between revisions of "Title Attribute Favlet"

From Level Access Web Labs
Jump to navigation Jump to search
Line 1: Line 1:
 
This Favlet displays the text of all title attributes.
 
This Favlet displays the text of all title attributes.
 +
 +
IE or Firefox: Right click the favlet and choose add Favorite or add bookmark to add it to your favorites/bookmarks bar.
 +
 +
Chrome or Safari: Drag to the bookmarks bar to add it as a bookmarklet.
  
 
<html>
 
<html>
<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 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://mraccess77.github.io/favlets/title.js">
 +
</iframe>
 
</html>
 
</html>
  
<h2> Sample code </h2>
 
<code>
 
<pre id="jcode">
 
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>
 
 
[[Category:Favlet]]
 
[[Category:Favlet]]

Revision as of 18:26, 14 September 2015

This Favlet displays the text of all title attributes.

IE or Firefox: Right click the favlet and choose add Favorite or add bookmark to add it to your favorites/bookmarks bar.

Chrome or Safari: Drag to the bookmarks bar to add it as a bookmarklet.

Title Attribute Favlet