<html>
<body>
<form>
First Name:<input id="fname"><br>
Last Name:<input id="lname"><br>
<input type="submit" id="sbmt">
</form>
<p>Click the button below to disable the submit button above.</p>
<button onclick="disableElement()">Disable Submit Button</button>
<script>
function disableElement()
{
document.getElementById("sbmt").disabled=true;
}
</script>
</body>
</html>