How to get the form id on page load jquery
How 开发者_StackOverflow中文版to get form id using JQuery on page load.
I am having a form in a page. I need to get that form's id using JQuery .
How can I do that..
thanks in advance...
$(document).ready(function(){
var formId = $('form').attr('id');
});
try
$(document).ready(function(){
alert($('form').attr('id'));
});
$(document).ready(function(){
$('form').each(function(){
alert($(this).attr('id')); // or simple this.id
})
})
精彩评论