plugin question
plugin question
I'm new to JQuery and creating plugins
Here is my plugin code:
-
(function($) {
$.fn.myPlugin= function(options){
var defaults = {
};
var options = $.extend(defaults,options);
return this.each(function(){
obj = $(this);
var listItems = $("li", obj);
});
};
})(jQuery);
and here is my HTML:
-
<div class="pluginStyle">
<li title="">list 1</li>
<li title="">list 2</li>
<li title="">list 3</li>
</div>
in the plugin, how would I check the number between each list tag and set it as a title attribute so i would end up with this:
-
<div class="pluginStyle">
<li title="1">list 1</li>
<li title="2">list 2</li>
<li title="3">list 3</li>
</div>
I know i don't need a plugin to do this, but I will eventually have to have this functionality in the plugin
thanks