JQuery插件

来源:互联网 发布:js foreach 获取index 编辑:程序博客网 时间:2024/05/16 05:57
html内容
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title>test</title>
<script type="text/javascript" src="jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
$(function(){
alert($.get("123"));
})
</script>
</head>
<body>
<p id="123">test</p>
</body>
</html>

插件内容
(function($){
$.get=function(string){
return document.getElementById(string);
}
})(jQuery);

0 0