<form id="form" action="servlet.do"> <input type="submit" name="action" value="Add" /> </form>How does one get the value of the form’s action attribute? form.action is of course right out, as that returns the <input> node. But what about:
var form = document.getElementById('form');
var action = form.getAttribute('action');
Makes sense, no? It turns out that this doesn’t work in Internet Explorer. In IE, the result of the getAttribute call is still the <input> node.The solution, as described in this forum (thx, MHenke!) is to dig into your DOM reference book and use getAttributeNode instead:
var form = document.getElementById('form');
var action = form.getAttributeNode('action').value;
And good times were had by all.

.jpg)