摘要:
<html><script language="JavaScript">function changFont( x ){ var font_style = x; var article = document.getElementById("article"); if( typeof font_style == "string" ){ article.style.fontWeight = font_style; } else { article.style.fontSize = font_style; }}< 阅读全文
摘要:
<script type="text/javascript">// 定义构造函数,并设定一个属性function Person(name){ this.name = name;}// 为 Person 增加一个方法Person.prototype.showName = function(){ alert("我叫" + this.name);};// new 关键字实例化一个对象var Tom = new Person("Tom");// 运行该对象内的 showName() 方法Tom.showName();</sc 阅读全文