JS visit meta example and css

Related Tags:

  Js can easily use the visit to the website can also handle the meta css.    Below is a relevant simple example. 

<html>
<head>
  <meta Name="myName" content="NorthSnow" /> 
  <meta Name="myCity" content="Chang Chun" /> 
  <meta Name="myCareer" content="IT" /> 
  <meta Name="myDream" content="more and more simple" /> 
  <title> This is a test </ title> 
  <style Type="text/css"> ... 
  . Css1 {...}{ 
  Color: red; font-weight: bold; 
  ) 

  . Css2 {...}{ 
  Color: blue; font-weight: normal; 
  ) 
  P {...}{ 
  Color: # 777777; 
  ) 
  </ Style> 

  <style Type="text/css"> ... 
  . Css3 {...}{ 
  Color: green; font-weight: bold; 
  ) 

  . Css4 {...}{ 
  Color: yellow; font-weight: normal; 
  ) 
  </ Style> 

  <script Language="javascript"> ... 
  Function showMeta () 
  (... 
  Var metas = document.getElementsByTagName ( "meta"); 
  Var strMeta = new String (); 
  Var strTemp; 
  For (var i = 0; i <metas.length; i + +) 
  (... 
  StrTemp [i] = metas. Name + "=" + metas [i]. Content + ""; 
  StrMeta = strMeta.concat (strTemp); 
  ) 
  Alert (strMeta); 
  ) 

  Function showCss () 
  (... 

  Var cSSs = document.styleSheets; 
  Var strCss = new String (); 
  Var strTemp; 
  Alert (cSSs.length); 
  For (var i = 0; i <cSSs.length; i + +) 
  (... 
  Var cRules [i] = cSSs. Rules; 
  For (var j = 0; j <cRules.length; j + +) 
  (... 
  StrTemp [j] = cRules. Style.cssText + ""; 
  StrCss = strCss.concat (strTemp); 
  ) 
  ) 
  Alert (strCss); 
  ) 

  Function setCss () 
  (... 
  Document.styleSheets [0]. Rules [0]. Style.cssText = 'color: # 8040f0'; 
  ) 
  </ Script> 
  </ Head> 
<body>
  <form Name="frmTest"> 
  <input Type="button" name="b1" value=" was meta" onclick="showMeta();"/> 
  <input Type="button" name="b2" value=" was css" onclick="showCss();"/> 
  <input Type="button" name="b2" value=" set css" onclick="setCss();"/> 
  </ Form> 
  <span Class="css1"> My Name is NorthSnow </ span> 
  </ Body> 
  </ Html> 


Related articles:

[] Understand their own career planning ~
  Yesterday saw Hao programmers on the upgrade: software engineering as career planning, Chen Hao, the most important thing to do when planning is two-fold: First, a clear understanding of their capabilities, strengths and character; Second, determine their own professional and would like to e...
Using flash open My Computer folder, and other special
  Today from the Empire to see a small forum postings, the Department found that some have. Flash may be used for local open My Computer, My Documents, Internet neighbours ....    Methods:    The use of the registry, the following are open to the registry keys of my compu...
CSS with the achievement of a picture frame Fillet
  Fillet do frame the more common practice is to cut picture Act.    This can produce arbitrary results.    However, if the request is relatively simple, and no time to cut plans, whether there is a more simple method?    The answer is yes.    We can use...
Practical Programming Flash 5 animation production - rain
  Ideas:    The whereabouts of paintings from the first drop of rain and then to disperse, and then continued to be copied to the raindrops on the screen, thereby creating the effect of rain.    Steps:    1. Opened Flash MX 2004, the new document, document size...
Beginners website recommends: HTML skills Advanced Application Guide (directory)
  1, HTML Application of Advanced Skills (1) language based on HTML (2006-01-21)    2, HTML Application of Advanced Skills (2) making good use of activities marking marquee title (2006-01-21)    3, HTML Application of Advanced Skills (c) make good use of a hyperlink label...