2016 - 1 - 27 javaScrip初步(一)
<head>
</head> <body>
<!-- The onclick attribute is the code
that happens when the element is clicked.
The value of the attribute is some
javascript code.
In this case it creates an alert
pop up dialog
-->
<h1 id="title" onclick="alert('hello');" >
Hello
</h1>
</body>
<head>
</head>
<body>
<!--
In this case the onclick functions
writes something to the console.
The console is an object so we use the
dot (.) notation to call a function
on it
-->
<h1 id="title"
onclick="console.log('hello');" >
Hello
</h1>
</body>
I don't know does the code " console.log('hello') " whether means make a object(console) do sth.?
2.How to use the jQuery
<head>
<!-- to use jQuery we need to import it like this -->
<script src=" http://code.jquery.com/jquery-1.11.3.min.js"></script>
</head>
<body>
<!--
in this example use use jQuery to
change the content itself.
The $ is shorthand for the jQuery function
We are passing in a CSS selector which
gets this element by its id.
The html function sets the html content
of an element
-->
<h1 id="title" onclick="$('#title').html('Goodbye');">
Hello
</h1>
</body>
3.How to define a function in javaScript
<head>
<script src = "http://code.jquery.com/jquery-1.11.3.min.js"></script>
</head> <body>
<h1 id="title" onclick="sayHello()"> Hello </h1>
</body>
<!--
the script tag is where you can put
more complex scripts
-->
<script type="text/javascript"> function sayHello() {
alert('Hello');
};
</script>
2016 - 1 - 27 javaScrip初步(一)的更多相关文章
- 2016.9.27 --- changchun
1001 Hanzo vs. Genji 1002 Fraction 1003 Rotate String 1004 Triangle 1005 The Fastest Runner Ms. Zhan ...
- 2016 - 1 - 25 CSS初步 (二)
1.The customising link We can change the link's style when we move our pointer on the link like that ...
- 2016 08 27 印刷菜单增加sql语句
insert into `module` (`ID`, `CONSONANTCODE`, `CREATEDATE`, `DESCRIPTION`, `HANDLER`, `HASCHILD`, `IC ...
- 2016.8.27 JavaScript入门之四
1.比较运算符“>”也可以,用数字和字符串进行比较: 2.比较运算符“&&”,表示并且: 3.比较运算符“||”,表示或者: 4.顺序是重要的,循环和if判断的顺序决定了,程序的 ...
- 2016.5.27 php测试中敏感度高,怎么调整
在测试PHP代码的过程中,会遇到这样的问题:PHP提示Notice: Undefined variable,遇到这样的问题很纠结,但是很容易解决. 今天晚上,我就遇到了这样的问题,到网上搜索了很多解决 ...
- 2016.5.27 Kal系统安装到U盘的方法,U盘启动Kali
本文我们聊一下如何把Kali Linux安装到移动硬盘或者U盘上,由移动硬盘独立引导,与本地系统完全隔离.U盘随身携带,只要PC的Bios支持USB启动,走到哪都可以使用自己的移动系统,方便工作和学习 ...
- Day3~Day7(2016/1/23~2016/1/27)
活动的生命周期:onCreate();onStart();onResume();onPause();onStop();onDestroy();onRestart(); 活动的启动模式:standard ...
- 2016 - 1 - 24 CSS初步
1.The difference between CSS and HTML HTML document is that it specities the content of the page. An ...
- 27、初步探索echarts源码
1.首先发现随笔中凡是和echarts相关的点击率都特别高,于是乎就接着写了echarts因为感觉要转点击率 首先声明我并不是专业做前端的,所以如果有些说得不对的地方,希望前端大神们出来指正 首先发现 ...
随机推荐
- AJAX总结
艾瑞宝迪,早上好,前端小菜鸟最近想更深入的了解ajax,无奈网上都没有看到合适系统的总结,于是心血来潮开始自己在博客园上的处女作,方便自己以后查看,也可以和大家一起交流
- Mysql执行大文件sql语句 -- 未测试
如果.sql文件过大,mysql会直接断开连接 解决方法: 在mysql的配置文件my.cnf 中加入 一行max_allowed_packet = 100M(该大小>=mysql.sql文件大 ...
- Isometric terrain
Isometric terrainhttp://forum.mapeditor.org/t/isometric-terrain/192/2 无透视地图的地形制作时,将每一贴图逆时针旋转45度,则比较容 ...
- android SDK下载及中文API地址
中文API:http://wiki.eoeandroid.com/Android_API_Guides Android Dev Tools官网地址:www.androiddevtools.cn 收集整 ...
- android studio gradle结构项目引入本地代码
1.首先需要用eclipse打开目标项目,file export,选择gradle file. 2.拷贝文件到as项目的根目录[可选] 3.找到as项目的根目录下 .idea目录,下面有个module ...
- http://www.cnblogs.com/huxi/archive/2010/07/04/1771073.html(转载)(原作者:AstralWind)
Python正则表达式指南 本文介绍了Python对于正则表达式的支持,包括正则表达式基础以及Python正则表达式标准库的完整介绍及使用示例.本文的内容不包括如何编写高效的正则表达式.如何优 ...
- 关于jquery中html()、text()、val()的区别
1. .html()用为读取和修改元素的HTML标签 对应js中的innerHTML .html()是用来读取元素的HTML内容(包括其Html标签),.html()方法使用在多个元素上时,只读 ...
- JavaWeb AJAX
1. Asynchronized JavaScript And XML 异步JavaScript和XML,它并不是一门新的语言或技术,实际是几项技术按一定的方式组合在一起共同的协作中发挥各自的作用, ...
- k8s pv
这个文档描述当前在k8s中PersistentVolumes的使用. 我们建议和volume一起进行了解 Introduction 管理存储和管理计算是截然不同的问题. 持久存储子系统对用 ...
- Android中的dp, px, pt
定义: px是像素,表示屏幕显示的最小元素单位 pt是磅数,一磅等于1/72英寸,一般用来作为字体的单位使用 问题: px和pt不使用于手机,因为同样的px在高低分辨率的手机上显示的比例不同 解决办法 ...