code: function(element) {
      var $el = $(element);
      //send online and offline events for every element
  
      // THIS ARE EVENTS GENERATED BY THE AGENT 
      // (BROWSER OR WEB VIEW IN PHONEGAP)
      $myelements.on("offline", function onElementOffline() {
        $el.trigger("offline");
      });
      $myelements.on("online", function onElementOnline() {
        $el.trigger("online");
      });
  
      // THIS ARE EVENTS GENERATED BY SOCKET.IO.
  
      // Fired upon a disconnection.
      $myelements.socket.on("disconnect", function onDisconnect() {
        $el.trigger("disconnect");
      });
      // send socket connect events
      $myelements.socket.on("connect", function onConnect() {
        $el.trigger("connect");
      });
      // Fired upon a successful reconnection.
      $myelements.socket.on("reconnect", function onReconnect() {
        $el.trigger("reconnect");
      });
      // Fired upon an attempt to reconnect.
      $myelements.socket.on("reconnecting", function onReconnecting() {
        $el.trigger("reconnecting");
      });
      //Fired upon a reconnection attempt error.
      $myelements.socket.on("reconnect_error", function onReconnectError() {
        $el.trigger("reconnect_error");
      });
      //Fired when couldn’t reconnect within reconnectionAttempts
      $myelements.socket.on("reconnect_failed", function onReconnectFailed() {
        $el.trigger("reconnect_failed");
      });
  
      // Trigger userinput event on automatic formsubmit event.
      $el.on("formsubmit", function onFormSubmit(ev, data) {
        $el.trigger("userinput", data);
      });
    }
docs: /*
  Gets an en element to trigger jQuery events like
  - offline
  - online
  - disconnect
  - connect
  - reconnect
  - reconnecting
  - reconnect_error
  - reconnect_failed
  
  @param {HTMLElement} element.