Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <form action="/some-api/" method="POST" onsubmit="disableButton()">
- <button id="btn" type="submit">Post</button>
- </form>
- <script>
- function disableButton() {
- var btn = document.getElementById('btn');
- btn.disabled = true;
- btn.innerText = 'Posting...';
- }
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement