Javascript Notes: Difference between revisions

From Federal Burro of Information
Jump to navigationJump to search
No edit summary
No edit summary
Line 1: Line 1:
<pre>
<pre>
function showattrs(theObject) {
function showattrs(theObject) {
   var out="&gt;pre&lt;"
   var out="&lt;pre&gt;"
   for (var attr in theObject) {
   for (var attr in theObject) {
       out+=attr+":"+ theObject[attr]+"\n"
       out+=attr+":"+ theObject[attr]+"\n"
   }
   }
   out+="%gt;/pre&lt;"
   out+="&lt;/pre&gt;"
   
   
   var block = document.getElementById("showattrs")
   var block = document.getElementById("showattrs")

Revision as of 16:06, 23 June 2010

function showattrs(theObject) {
   var out="<pre>"
   for (var attr in theObject) {
      out+=attr+":"+ theObject[attr]+"\n"
   }
   out+="</pre>"
 
   var block = document.getElementById("showattrs")
   block.innerHTML=out
}