test:
<!doctype html>
<html ><head>
<meta charset="utf-8">
<title>新建对象方法插件</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js">
</script>
<script src="plugin2.js"></script>
<script>
$().ready(function(){
$("input").click(function(){
$("input").test();
});
});
</script>
</head>
<body>
<input type="button" value="新建对象方法插件"/>
</body>
</html>
plugin2.js:
$.fn.extend({
test:function(){
console.log($("input").val());
}
});