the code for jQuery fn funciton
example code
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title></title>
<script src="jquery-1.4.min.js" type="text/javascript"></script>
<script type="text/javascript">
$.fn.jQueryAlert = function() {
window.alert($(this).attr('id'));
}
$(document).ready(function() {
$('#jQuery-1').jQueryAlert();
});
</script>
</head>
<body>
<div id="jQuery-1"> use $.fn </div>
</body>
</html>


浙公网安备 33010602011771号