How to get form id using jQuery on page load.
I have a form on the page. I need to get this form id using jQuery.
How can i do this.
thanks in advance...
to try
$(document).ready(function(){ alert($('form').attr('id')); });
$(document).ready(function(){ var formId = $('form').attr('id'); });
$(document).ready(function(){ $('form').each(function(){ alert($(this).attr('id')); // or simple this.id }) })