Question: I have two submit button in a form I want to disable button2 on click (submit) & when user click button1, button2 will enable. Sorry for silly question I am newbie.

```js
   $(document).ready(function(){
            $(document).on("click", ".test2", function() {
                if ($('#test2').is(':visible')) {
                    $('#test2').hide();
                } else {
                    $('#test2').show();
                };
            });
        });
```

```html
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<form id="test" method="post">
    <input id="test" type="submit" value="button1" class="test1">
    <input id="test2" type="submit" value="button2"/>
</form>
```

Answer: 
Clicke event is bidden on class change it to id

```
$(document).on("click", "#test2", function()

```

Here is a sample code.

```html
<!DOCTYPE html>
<html>

<head>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>

    <script type="text/javascript">
        $(document).ready(function () {
            $(document).on("click", "#test2", function (e) {
                if ($('#test2').is(':visible')) {
                    $('#test2').hide();
                    e.preventDefault();
                } else {
                    $('#test2').show();
                    e.preventDefault();
                };
            });
        });
    </script>
</head>

<body>

    <form id="test" method="post">
        <input id="test" type="submit" value="button1" class="test1">
        <input id="test2" type="submit" value="button2" />
    </form>
</body>

</html>
```
How about this?
Add `disabled` to `#test2` and remove it when `#test` is clicked.

```html
<!DOCTYPE html>
<html>

<head>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>

    <script type="text/javascript">
        $(document).ready(function () {
            $("#test").on("click", function () {
    $("#test2").prop("disabled",false);
             });
        });
    </script>
</head>

<body>

    <form id="test" method="post">
        <input id="test" type="button" value="button1" class="test1">
        <input id="test2" type="button" value="button2" disabled />
    </form>
</body>

</html>
```