I seeing a java script function on web page which used with() at the top of function and rest of function implementation doing within with() statement. I put the function code below for reference.
function calculate()
{
with (document.loan)
{
var loan = parseFloat(loan_amount.value);
//function implementation goes here
}
}
Form is define like this in page with name of loan.
<form name="loan" id="loan-form">
<input type="text" id="loan_amount"/>
// remaining form elements here
</form>
What is doing this "with" statement and what's it scope ?