cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

Quick-add: + add another resource

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

Quick-add: + add another resource

Code Indentation

     

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

            
              <ul id="navigation">
  		<li><a href="index.html" accesskey="1">Home</a></li>
  		<li><a href="photo.html" accesskey="2">Photo</a></li>
  		<li><a href="book.html" accesskey="3">Book</a></li>
  	</ul>
    <h1>What is the Document Object Model?</h1>
    <p>
The <abbr title="World Wide Web Consortium">W3C</abbr> defines
 the <abbr title="Document Object Model">DOM</abbr> as:
    </p>
    <blockquote cite="http://www.w3.org/DOM/">
      <p>
A platform- and language-neutral interface that will allow programs
 and scripts to dynamically access and update the
 content, structure and style of documents.
      </p>
    </blockquote>
    <p>
It is an <abbr title="Application Programming Interface">API</abbr>
 that can be used to navigate <abbr title="HyperText Markup Language">
HTML</abbr> and <abbr title="eXtensible Markup Language">XML
</abbr> documents.
    </p>
            
          
!
            
                  	body {
  font-family: "Helvetica","Arial",sans-serif;
  font-size: 10pt;
}
abbr {
  text-decoration: none;
  border: 0;
  font-style: normal;
}
            
          
!
            
              function addLoadEvent(func){
	var oldonload = window.onload;
	if(typeof window.onload !="function"){
		window.onload = func;
	}else{
		window.onload = function(){
			oldonload();
			func();
		}
	}
}


//创建“缩略语列表”函数
function displayAbbreviations(){
	//检查兼容性
	if(!document.getElementById || !document.createElement || !document.createTextNode) return false;
	
	//取得缩略词
	var abbreviations = document.getElementsByTagName("abbr");
	if(abbreviations.length < 1) return false;
	var defs = new Array();
	//遍历这些缩略词
	for(var i = 0;i < abbreviations.length;i++){
		var current_abbr = abbreviations[i];
		
		if(current_abbr.childNodes.length < 1) continue;
		
		var definition = current_abbr.getAttribute("title");
		var key = current_abbr.firstChild.nodeValue;
	
		defs[key] = definition;
	}
	
	//创建标记
	var dlist = document.createElement("dl");
	for(key in defs){
		var definition = defs[key];
		var dtitle = document.createElement("dt");
		var dtitle_text = document.createTextNode(key);
		dtitle.appendChild(dtitle_text);
		
		var ddesc = document.createElement("dd");
		var ddesc_text = document.createTextNode(definition);
		ddesc.appendChild(ddesc_text);
		
		dlist.appendChild(dtitle);
		dlist.appendChild(ddesc);
	}
	
	if(current_abbr.childNodes.length < 1) return false;
	
	var header = document.createElement("h2");
	var header_text = document.createTextNode("Abbreviations");
	header.appendChild(header_text);
	
	//插入到body中去
	document.body.appendChild(header);
	document.body.appendChild(dlist);
	
}

//创建“文献来源链接”函数
function displayCitations(){
	//检查兼容性
//	if(!document.getElementsByTagName || !document.getCreateElement || !document.createTextNode) return false;
	
	//取得所有引用
	var quotes = document.getElementsByTagName("blockquote");
	//遍历引用
	for(var i = 0;i < quotes.length;i++){
		//如果没有cite属性,继续循环
		if(!quotes[i].getAttribute("cite")) continue;
		//保存cite属性
		var url = quotes[i].getAttribute("cite");
		//取得引用中的所有元素节点
		var quoteChildren = quotes[i].getElementsByTagName("*");
		//如果没有元素节点,则继续循环
		if(quoteChildren.length < 1) continue;
		//取得引用中的最后一个元素节点
		var elem = quoteChildren[quoteChildren.length - 1];
		
		//创建标记
		var links = document.createElement("a");
		var links_text = document.createTextNode("source");
		links.appendChild(links_text);
		links.setAttribute("href",url);
		
		//插入链接
		var supscript = document.createElement("sup");
		supscript.appendChild(links);
		//把标记添加到引用中的最后一个元素节点
		elem.appendChild(supscript);
	}
}

//创建“快捷键清单”函数
function displayAccesskeys(){
	//取得链接a
	var links = document.getElementsByTagName("a");
	
	var defs = new Array();
	
	//遍历链接a
	for(i = 0;i < links.length;i++){
		var current_link = links[i];
		//如果a没有 accesskey属性,则跳出循环
		if(!current_link.getAttribute("accesskey")) continue;
		var key = current_link.getAttribute("accesskey");
		//取得链接文本
		var text = current_link.firstChild.nodeValue;
		//添加到数组
		defs[key] =text;
	}
	
	var list = document.createElement("ul");
	//遍历访问键
	for(key in defs){
		var text = defs[key];
		var li = document.createElement("li");
		var li_text = document.createTextNode(key + ":" + text);
		li.appendChild(li_text);
		list.appendChild(li);
	}
	
	var header = document.createElement("h3");
	var header_text = document.createTextNode("Accesskeys");
	header.appendChild(header_text);
	
	document.body.appendChild(header);
	document.body.appendChild(list);
}


addLoadEvent(displayAbbreviations);
addLoadEvent(displayCitations);
addLoadEvent(displayAccesskeys);
            
          
!
999px
Loading ..................

Console