zoukankan      html  css  js  c++  java
  • jquery实践1

    1,今天发现jquery获取的dom对象除了jquery对象外,还可以访问原来的对象,只要加一个[]就行了,原来还有这样的功能,之前没仔细研究。

    2,用了first-child,nth-child(n),获取元素集合里面的第几个元素。

    3,用Jquery访问nodeText节点,通过访问原来的对象,nextSibling访问。访问是nextSibling.nodeValue;

    <!DOCTYPE HTML>
    <html>
      <head>
        <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
        <title>Zephyr's Document</title>
    	<script src="http://common.cnblogs.com/script/jquery.js"></script>
        <style type="text/css" media="screen">
        /*<![CDATA[*/
    
        /*]]>*/
        </style>
    	<script type="text/javascript">
    	$(function(){
    	var tempBr=$("br");
    	tempBr.each(function(index,doElem){
    		doElem.nextSibling.nodeValue=doElem.nextSibling.nodeValue.replace(/\s{6}/g,"");
    	})})
    	</script>
        </head>
    	<body>
    	asdf
    		<br />
    		"      asdf"
    		<br />
    		"      asdf"
    		<br />
    		"      asdf"
    	</body>
    </html>
    

      

  • 相关阅读:
    搜刮一些开源项目的APP
    iOS Crash文件的解析
    iOS中RGB颜色转换
    随笔杂记
    iOS字体
    方法总结
    经验点滴
    个人理解
    OC 知识点回顾
    IOS UI 笔记整理回顾
  • 原文地址:https://www.cnblogs.com/babyzone2004/p/2195875.html
Copyright © 2011-2022 走看看