How can i make only the one i choose to hide?

Suppose i have 100 buttons, and i wanna make hide only 1, but i made the buttons with a for, is there a way to make that?

!DOCTYPE html>
<script src=""></script>

<!-- begin snippet: js hide: false console: true babel: false -->


<button id="1">Hide</button>
<button id="2">Hide</button>
<button id="3">Hide</button>


Try this,

for (let i = 1; i <= 3; i++)

Use the for loop inside the $(document).ready and use this instead of again querying the button

Leave a Reply

Your email address will not be published. Required fields are marked *