javascript 简单语法 对象属性及方法
2024-08-31 08:35:08
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<body>
<p id="demo"></p>
<script>
var person = {
firstName: "John",
lastName : "Doe",
id : 5566,
fullName : function(){ // 怎样创建訪问对象方法
// return this.firstName + " " + this.lastName;
return this.firstName + " " + this.lastName;
}
};
document.getElementById('demo').innerHTML = person.fullName();//调用对象方法
</script>
</body>
</html>
最新文章
- block
- 通过泛型数据,操作SQL数据库
- 操作TAB文件和TStringGrid赋值;
- (笔记)Linux内核学习(八)之定时器和时间管理
- 弦图的判定MCS算法(zoj1015)
- ZOJ 3804--解题报告
- JUC之Atomic系列12大类实例讲解和原理分解
- appcompat_v7/res/values-v21/themes_base.xml No resource found that matches the given name
- 基于NodeJs的网页爬虫的构建(二)
- 字符(汉子)转换为ASCII
- QTestLib Tutorial
- 25_Downloading An Image
- Java对象序列化/反序列化的注意事项
- 【UML 建模】活动图介绍
- 【Spring】手写Spring MVC
- 100-days: twenty-five
- docker简单搭建gitlab
- 使用vmware vconverter从物理机迁移系统到虚拟机P2V(多图)
- Python模拟人猜数过程(折半查找)
- P3810 -三维偏序(陌上花开)cdq-分治
热门文章
- UI各种小控件的用法
- HDU 2874 LCA离线算法 tarjan算法
- MapReduce编程之倒排索引
- Mina airQQ聊天 client篇(三)
- Django -&;gt; debug模式下的静态文件服务(/media/)
- System.DirectoryServices Namespace
- CentOS 7 安装 vmware tools 提示The path ";"; is not a valid path to the 3.10.0-957.el7.x86_64 kernel headers.
- category与协议的不同
- Oracle 新手语法记录
- .NET MVC权限设计思考之切入点