<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style type="text/css">
#a{
background: red;
}
</style>
</head>
<body>
<div id="a"></div>
</body>
<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
<script type="text/javascript">
jQuery.fn.extend({
setWidth:function(){
$(this).width(200);
$(this).height(300);
return this;
}
});
$("#a").setWidth();
</script>
</html>