1
rated 0 times
[
5]
[
4]
/ answers: 1 / hits: 166978
/ 15 Years ago, sat, june 13, 2009, 12:00:00
I need to get a reference to the FORM parent of an INPUT when I only have a reference to that INPUT. Is this possible with JavaScript? Use jQuery if you like.
function doSomething(element) {
//element is input object
//how to get reference to form?
}
This doesn't work:
var form = $(element).parents('form:first');
alert($(form).attr(name));
More From » jquery