I am just writing a simple plugin for my own use in a web page. I have html markup like:
<ul id="ulview">
<li>...</li>
<li>...</li>
...
</ul>
and jQuery plugin code:
(function($) {
$.fn.ulView = function(){
//console.log(this);
this.children('li').each(function(){
alert('test');
});
}
})(jQuery);
and I apply the plugin like this:
jQuery(document).ready(function($) {
$('#ulview').ulView();
}
For some reason the alert('test') never runs. but I can see the jQuery object has been logged in the console. what do I miss here, thanks for any input.