2013年4月1日
摘要: <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; }}< 阅读全文
posted @ 2013-04-01 14:33 飞翔@骑士 阅读(293) 评论(0) 推荐(0) 编辑
摘要: <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 阅读全文
posted @ 2013-04-01 14:16 飞翔@骑士 阅读(119) 评论(0) 推荐(0) 编辑