`
backspace
  • 浏览: 133112 次
文章分类
社区版块
存档分类
最新评论

jQuery:1.[3

 
阅读更多
ylbtech-jQuery:jQuery学习
jQuery:1.3.1,改变HTML元素内容返回顶部
<html>
<head>
<script type="text/javascript" src="jquery/jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
  $("button").click(function(){
  $("p").html("W3School");
  });
});
</script>
</head>

<body>
<h2>This is a heading</h2>
<p>This is a paragraph.</p>
<p>This is another paragraph.</p>
<button type="button">请点击这里</button>
</body>

</html>
jQuery:1.3.2,向HTML元素追加内容返回顶部
<html>
<head>
<script type="text/javascript" src="jquery/jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
  $("button").click(function(){
  $("p").append(" <b>W3School</b>.");
  });
});
</script>
</head>

<body>
<h2>This is a heading</h2>
<p>This is a paragraph.</p>
<p>This is another paragraph.</p>
<button type="button">请点击这里</button>
</body>

</html>
jQuery:1.3.3,在HTML元素之后追加内容 返回顶部
<html>
<head>
<script type="text/javascript" src="jquery/jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
  $("button").click(function(){
  $("p").after(" W3School.");
  });
});
</script>
</head>

<body>
<h2>This is a heading</h2>
<p>This is a paragraph.</p>
<p>This is another paragraph.</p>
<button type="button">请点击这里</button>
</body>

</html>
jQuery:1.4.1,改变HTML元素的CSS属性返回顶部
<html>
<head>
<script type="text/javascript" src="jquery/jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
  $("button").click(function(){
  $("p").html("W3School");
  });
});
</script>
</head>

<body>
<h2>This is a heading</h2>
<p>This is a paragraph.</p>
<p>This is another paragraph.</p>
<button type="button">请点击这里</button>
</body>

</html>
jQuery:1.4.2,改变多个CSS属性返回顶部
<html>
<head>
<script type="text/javascript" src="jquery/jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
  $("button").click(function(){
    $("p").css({"background-color":"red","font-size":"200%"});
  });
});
</script>
</head>

<body>
<h2>This is a heading</h2>
<p>This is a paragraph.</p>
<p>This is another paragraph.</p>
<button type="button">Click me</button>
</body>

</html>
jQuery:1.4.3,获得元素的CSS属性返回顶部
<html>
<head>
<script type="text/javascript" src="jquery/jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
  $("div").click(function(){
  $("#result").html($(this).css("background-color"));
  });
});
</script>
</head>

<body>
<div style="width:100px;height:100px;
background:#ff0000"></div>
<p id="result">Click in the box</p>
</body>
</html>
jQuery:1.5.1,使用 $(selector).load(url) 来改变 HTML 内返回顶部
<html>
<head>
<script type="text/javascript" src="jquery/jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
  $("#b01").click(function(){
  $('#myDiv').load('jquery/test1.txt');
  });
});
</script>
</head>
<body>

<div id="myDiv"><h2>通过 AJAX 改变文本</h2></div>
<button id="b01" type="button">改变内容</button>

</body>
</html>
jQuery:1.5.2,使用 $.ajax(options) 来改变 HTML 内容 返回顶部
<html>
<head>
<script type="text/javascript" src="jquery/jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
  $("#b01").click(function(){
  htmlobj=$.ajax({url:"jquery/test1.txt",async:false});
  $("#myDiv").html(htmlobj.responseText);
  });
});
</script>
</head>
<body>

<div id="myDiv"><h2>通过 AJAX 改变文本</h2></div>
<button id="b01" type="button">改变内容</button>

</body>
</html>

 

   
1
4
分享到:
评论

相关推荐

    jquery-3.3.1.js和jquery-3.3.1.min.js

    jquery-3.3.1.js和jquery-3.3.1.min.js免费下载哈。jquery-3.3.1.js和jquery-3.3.1.min.js免费下载哈。jquery-3.3.1.js和jquery-3.3.1.min.js免费下载哈。jquery-3.3.1.js和jquery-3.3.1.min.js免费下载哈。jquery-...

    jquery 1.12.4 .min.js 含源码

    jquery 1.12.4 .min.js 含源码 包含以下文件: jquery.1.12.4.min.js jquery.1.12.4.js // 这个是源码哦 截至2017.11.21, jQuery1.x 最新最稳定版本

    jquery.rangecss.rar

    Jquery 滚动滑块设置,可模拟一点时间内的时间轴选择;资源包含完整例子:jquery.range.js jquery.range.css

    Jquery.media.js插件

    Jquery.media.js插件,包含三个文件:jquery.media.js、jquery-1.7.2.min.js、demo.html demo文件如下: &lt;html&gt; &lt;head&gt; [removed][removed] [removed][removed] [removed] $(function() { $('....

    jquery.jSelectDate.js 下拉列表式日期选择插件实例.rar

    jquery.jSelectDate.js 下拉列表式日期选择器插件实例,...功能介绍:1.支持闰年、大小月和二月天数的处理  2.新增一个Span标签的外框,以便于设置样式  3.新增可设置是否在下拉列表后面加入“年、月、日”几个字

    jquery-2.table2excel

    1、需要引入jquery.js和jquery.table2excel.min.js 2、增加绑定事件,例子: ------------------- //导出excel $("#output").click(function(){ var myDate = new Date(); $("#example").table2excel({ exclude: ...

    jquery-3.6.0.min(1).js

    jquery-3.6.0.min(1).js

    jquery-1.7.1.min.js

    jquery-1.7.1.js 和jquery-1.7.1.min.js

    jQuery1.11.1.min.js和jquery2.1.1.js.zip

    本次提供的有:jquery-1.11.1.js、jquery-1.11.1.min.js、jquery-... 3、2.x版本和1.x版本有着相同的API,但2.x版本不再支持IE6、IE7和IE8。 4、当前IE6、7、8的用户还是很多的,所以一般实际应用还是选择1.x版本的多。

    jquery.cookie.js

    jquery.cookie.js 使用方法: var cookie_name="submenu_cookie"; var value="selected"; var options={path:'/',expires:1}; 设置: $.cookie(cookie_name,value,options); 取值:$.cookie(cookie_name)

    jquery-1.7.2.js免费下载

    而相比于1.7.2 RC1,只修复了一个bug。值得注意的是:如果你正在使用jQuery Mobile,请使用最新的jQuery 1.7.2和jQuery Mobile 1.1这两个版本,因为之前的jQuery Mobile版本还基于jQuery core 1.7.1或更早的版本。 ...

    jQuery-1.11.3.min.js.zip

    jQuery1.11.3 版本来自jQuery官网,在1.x版本中,jQuery1.11.3比较稳定,经典,本次提供的包括jquery-1.11.3.min.js和jquery-1.11.3.js两个文件,欢迎各位开发人员使用! jquery-1.11.3 直引地址: 百度压缩版...

    jquery-3.3.1.js/min.js

    jquery-3.3.1.js/min.js

    jquery.SuperSlide.2.1.1.js.下载

    轮播图、标签切换,教程地址:http://www.superslide2.com/demo.html

    jquery图片播放器 - jquery.fn.imgplayer-1.2

    1. 项目编码为GBK 2. 目前播放模式支持 1:溶解,2:挂历模式,3:滑动(从左到右),4:滑动(从上到下),5:滑动(从下到上),6:滑动(从右到左),善不支持随机模式 3. 在IE6,IE8,FF下测试通过 4. 支持任意数量图片,使用...

    kendoui.for.jquery.2018.3.911.commercial

    Telerik Collection for .NET 2018 R3 kendoui.for.jquery.2018.3.911.commercial

    jquery.bgiframe.js

    IE6下解决弹出div 被父页面的... 1.下载jquery.bgiframe.js ,在我的下载资源中有 2.需要修改div的属性,使用 $(function(){ $('#addDiv').bgiframe(); }); 下面是addDiv html: &lt;input /&gt; &lt;/div&gt;

    jquery.ui.datepicker.js

    一个非常棒的时间插件 &lt;script language="javascript"&gt; $(document).ready(function() { ... monthNames:['1月','2月','3月','4月','5月','6月','7月','8月','9月','10月','11月','12月'], }); }); &lt;/script&gt;

    jquery-3.2.1.js 、 jquery-3.2.1.min.js 【jquery包,最新的截止到2017-11-1】

    jquery-3.2.1.js 、 jquery-3.2.1.min.js 【jquery包,最新的截止到2017-11-1】。

    jquery.wordexport.js-master.zip

    3、jquery.wordexport.js默认导出的word是web模式打开,此资源已经添加了默认文档模式,自行修改代码注释即可。 4、直接将echarts导出word将不会有图片,可以调用echarts的getDataURL()获取echarts图的base64编码给...

Global site tag (gtag.js) - Google Analytics