zoukankan      html  css  js  c++  java
  • dom转换成jquery对象

    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
    "http://www.w3.org/TR/html4/strict.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml" lang="en">
    	<head>
    		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    		<title></title>
    		<script type="text/javascript" src="../js/jquery-1.8.0.js"></script>
    	</head>
    	<body>
    		<script type="text/javascript">
    			/*DOM 对象转成 jQuery 对象 示例*/
    			$(document).ready(function() {
    				var div=document.getElementById("mydiv");
    				alert(div.title);
    				alert(div.children.prototype);  
    				var $div2=$(div);
    				$div2.click(function(){ 
    					alert("click function!!!");
    				});
    			});		
    		</script>	
    		
    		<div id="mydiv" title="mydiv_title">
    			<p>hello  jquery</p>			
    		</div>
    	</body>
    </html>
      
    

      

  • 相关阅读:
    linux
    网络编址
    抽象类 接口
    mysql
    java
    [lyu]Mysql解压版安装教程
    Mysql出现拒绝本地账户访问的情况副本
    js
    Redis限流和GeoHash
    布隆过滤器
  • 原文地址:https://www.cnblogs.com/1020182600HENG/p/6752696.html
Copyright © 2011-2022 走看看