<!DOCTYPE html>
<html>
<head>
</head>
<body>
<form id="form-id" name="form-name" action="save_post.php" accept-charset="UTF-8" method="POST">
worker name: <input type="text" name="wname" value="Javava"><br />
company name: <input type="text" name="cname" value="Disneyland"><br />
<button id="button-id" type="submit">Form Button</button>
</form>
<script>
function getFormName()
{
document.getElementById("p-id").innerHTML = document.getElementById("form-id").name;
}
/*
run:
form-name
*/
</script>
<button onclick="getFormName()">Get Form Method</button>
<p id="p-id"></p>
</body>
</html>