Javascript Jquery插件在函数原型中检索id

Javascript Jquery插件在函数原型中检索id,javascript,jquery,html,plugins,prototype,Javascript,Jquery,Html,Plugins,Prototype,我得到了以下jquery插件代码,我想检索受插件影响的元素的id。有什么想法请帮忙 我拉小提琴 /************Début插件*****************************************************/ var sgii_chrono_obj (function($){ // chronometre avec ou sans dixième de seconde function Osgii_chrono(el, options)

我得到了以下jquery插件代码,我想检索受插件影响的元素的id。有什么想法请帮忙

我拉小提琴

/************Début插件*****************************************************/

    var sgii_chrono_obj

    (function($){

// chronometre  avec ou sans dixième de seconde
function Osgii_chrono(el, options) {

    // defaults options:
    this.defaults = {

        // afficher au dixième de seconde
        affDixieme: false, 

        // Déclenche le timer automatiquement
        autoStart: false, 

        // afficher le timer dans le div
        affTimer: true
    };

    // extending options:
    this.opts = $.extend({}, this.defaults, options);

    // the element:
    this.$el = $(el);
}

// separate functionality from object creation
Osgii_chrono.prototype = {

    // initializes plugin
    init: function() {
        var _this = this;
我要追溯我的过去

            var monId = ?????
            /* init plugin here */

        this.setOptions(this.opts);
    },

    // sets the new options
    setOptions: function(options){
        var _this = this;
        options = $.extend({}, this.opts, options);

        /* handle changes here */

        //store options
        this.opts = options; 
    },

    // Fonction pour démarrage du chrono
    startChrono: function() {
        var _this = this;
                    var _el = this.$el;
                   //this.html('on est parti');
    },

    // Fonction pour arrêter le chrono
    stopChorno: function() {
        var _this = this;
    },

    // Fonction pour réinitialiser le chrono
    resetChrono: function() {
        var _this = this;
    }
};

// the actual plugin
$.fn.osgii_chrono = function(options) {
    var rev = null, l = this.length;

    if(l && this.each) {
        this.each(function() {
            rev = $(this).data('osgii_chrono');
            if(typeof rev === 'undefined') {
                rev = new Osgii_chrono(this, options);
                rev.init();
                $(this).data('osgii_chrono', rev);
            }
            else if(options) {
                rev.setOptions(options);
            }
        });
    }

    if(l === 1) return rev;
};

    })(jQuery);
html


jQuery中的任何属性都可以通过attr函数检索

$("<selector>").attr("<attribute-name>");

为什么你在你的问题中随机改变语言?我的代码中的注释是法语,因为它是我的母语谢谢@JNF非常有效great@JBedard我把它贴出来作为答复。如果合适的话,你可以接受
    var objMyChrono
    $(document).ready(function(){

/* add code here */
objMyChrono = $('#myChronoJb').osgii_chrono({ /* options */ });
objMyChrono.startChrono();
$("<selector>").attr("<attribute-name>");
el.attr("id");