My first jQuery Plugin [closed]

Xerross

New Member
i recently started learning jQuery and created a plugin for preventing browser autofill/suggestion. Could you guys see and let me know if I can do it it any better?Here's the code\[code\](function($){ var sTime = new Date().getTime(); $(function(){ return $('form').each(function(i, frm){ var inputs = $(frm +':input'); $.each(inputs, function(){ if($(this).attr('type') == 'text') $(this).attr('name', $(this).attr('name') + "_" + sTime); }); $(frm).bind('submit', function(){ var inputs = $(frm +':input'); $.each(inputs, function(){ if($(this).attr('type') == 'text') $(this).attr('name', $(this).attr('name').replace('_'+sTime, '')); }); }) }) })})(jQuery);\[/code\]
 

Nullified

New Member
Can you give us a product that is not minimized so we can properly decode, debug and test?

If you're not worried about W3C validation you could use autocomplete="off" on your form elements, but the autocomplete attribute is only compatible with IE & FF. For W3C validation you could use javascript: .setAttribute( "autocomplete", "off" );
 
Top