javascript element by name code example
Example 1: check the doc name in javascript
var path = window.location.pathname;
var page = path.split("/").pop();
console.log( page );
Example 2: javascript get element by name
document.getElementsByName("acc")[0].value