/// <reference path="jquery-1.7.1.min.js" />
(function ($) {
//สร้างชื่อฟังชั่นไว้ใช้งานเอง
$.fn.myhightlight = function () {
return this.each(function(){
$(this).css('background-color','#aa0000')
});
}
})(jQuery)
เอาไปใช้กับไฟล์ MyScript.js
/// <reference path="jquery-1.7.1.min.js" />
/// <reference path="jQueryPlugin.js" />
$(document).ready(function () {
$('#studentid').myhightlight();
});
เวลาพิมพ์โค้ดใน jQuery ถ้าอยากให้มันมี Inteligent ช่วยใช้ลากไฟล์มาวางในไฟล์ ที่ต้องการพิมพ์พอลากมาแล้วมันจะเป็น //ชื่อไฟล์ jQuery ที่เรียกใช้

