jQuery.Model.prototype.elements  function     

Returns elements that represent this model instance. For this to work, your element's should us the identity function in their class name. Example:

<div class='todo <%= todo.identity() %>'> ... </div>

This also works if you hooked up the model:

<div <%= todo %>> ... </div>

Typically, you'll use this as a response of an OpenAjax message:

"todo.destroyed subscribe": function(called, todo){
  todo.elements(this.element).remove();
}

API

model.elements(context) -> jQuery
{String|jQuery|element}

If provided, only elements inside this element that represent this model will be returned.

{jQuery}

Returns a jQuery wrapped nodelist of elements that have this model instances identity in their class name.

© Jupiter IT - JavaScriptMVC Training and Support