What are the potential pitfalls of using JavaScript to disable a button after it has been clicked?

Potential pitfalls of using JavaScript to disable a button after it has been clicked include the possibility of users being able to re-enable the button through browser developer tools or by manipulating the DOM. To solve this issue, a more secure approach would be to combine JavaScript with server-side validation, such as using PHP to disable the button after it has been clicked.

<?php
if(isset($_POST['submit'])){
    // Process form data
    
    // Disable button after form submission
    echo '<script>document.getElementById("myButton").disabled = true;</script>';
}
?>

<form method="post">
    <!-- Form fields here -->
    
    <button id="myButton" type="submit" name="submit">Submit</button>
</form>