I would suggest using closest
, which selects the closest matching parent element:
$('input[name="submitButton"]').closest("form");
Instead of filtering by the name, I would do this:
$('input[type=submit]').closest("form");
More Related Contents:
- jQuery find closest previous sibling with class
- How to select all content between two tags in jQuery
- Iterating over element attributes with jQuery
- How can I find the closest previous sibling with class using jQuery?
- Jquery how to find an Object by attribute in an Array
- How to find and replace a text in comments using JQuery [closed]
- How to use jQuery with Angular?
- Wildcards in jQuery selectors
- Set select option ‘selected’, by value
- Click event on select option element in chrome
- jQuery add class .active on menu
- How to rotate a div using jQuery [closed]
- jqGrid: using beforeProcessing to populate filterToolbar selection boxes
- How can I keep selected Bootstrap tab on page refresh?
- Delay jquery hover event?
- Simulate click on select element with jQuery
- Merging jQuery objects
- jQuery Focus fails on firefox
- Bootstrap throws Uncaught Error: Bootstrap’s JavaScript requires jQuery [closed]
- Limit Checkbox amount
- Redirecting after AJAX post in Django
- How to change height div on window resize?
- How do I pass a Dictionary as a parameter to an ActionResult method from jQuery/Ajax?
- jquery live event for added dom elements
- Fancybox2 – different content for tooltip and image title, both from title attribute?
- jQuery: Test if checkbox is NOT checked
- Manually set unobtrusive validation error on a textbox
- How to submit form without refreshing page using Django, Ajax, jQuery?
- jQuery Removing specific text from an element
- scroll up and down a div on button click using jquery