jQuery简单入门
2009-06-08 12:23
435 查看
首先在文件中引用:
<script type="text/javascript" src="../Library/jquery1.3.1/dist/jquery.js"></script>
<script type="text/javascript" src="hello.js"></script>
页面中有一个元素的类名为hello:
<div class=’hello’></div>
hello.js文件只有简单的内容:
$(document).ready(function() {
$('.hello').addClass('hellocss');
}); 其中hellocss为CSS样式表: .hellocss{
font-style: italic;
border: 1px solid #888;
padding: 0.5em;
margin: 0.5em 0;
background-color: #ffc;
} 这样打开页面后class为hello的div的样式就会设置成hellocss的样式.
<script type="text/javascript" src="../Library/jquery1.3.1/dist/jquery.js"></script>
<script type="text/javascript" src="hello.js"></script>
页面中有一个元素的类名为hello:
<div class=’hello’></div>
hello.js文件只有简单的内容:
$(document).ready(function() {
$('.hello').addClass('hellocss');
}); 其中hellocss为CSS样式表: .hellocss{
font-style: italic;
border: 1px solid #888;
padding: 0.5em;
margin: 0.5em 0;
background-color: #ffc;
} 这样打开页面后class为hello的div的样式就会设置成hellocss的样式.
相关文章推荐
- jQuery的Form插件jquery.form.js的简单入门
- JQuery简单入门
- jQuery简单入门示例之用户校验demo示例
- jQuery简单入门
- jQuery 语法简单介绍和入门学习
- jQuery pjax 简单入门
- jQuery的Form插件的简单入门
- jQuery简单入门
- JQuery入门―编写一个简单的JQuery应用案例
- 使用 ADD-ON SDK 开发 基于 Html JQuery 和 CSS 的 firefox 插件入门教程1: 创建一个简单的 Add-on
- jQuery简单入门
- jquery入门1:简单收缩菜单
- j2ee 简单网站搭建:(八)使用 jquery-validate 实现页面验证入门
- jQuery的简单入门练习
- Struts2 + json + Jquery 简单入门登陆
- jQuery简单入门
- jQuery简单入门
- jquery 验证插件的简单入门使用
- JQuery入门级简单教程
- jquery简单使用入门