I am trying to make a jquery function, and used below code, but not getting any output. Please tell me the process to make it.
<script type="text/javascript">
(function($){
$.fn.myplugin = function(){
alert(this.id);
};
})(jQuery);
$("#sample").myplugin();
</script>
scripttag placed below the HTML? if not, wrap the code with$(document).ready(function() { // here goes your code });