<button id="btnOK">button ok (1st)</button><br/> <button id="btnOK">button ok (2nd)</button><br/> <button id="btnOK">button ok (3rd)</button><br/> <button id="btnOK">button ok (4th)</button><br/> <hr/><br/> <button id="btnReload">Reload</button><br/><br/> <button id="btnHideWithID">Hide buttons with ID selector</button><br/><br/> <button id="btnHideWithAttr">Hide buttons with attribute selector</button>
$("#btnHideWithID").on("click",function(){ $("#btnOK").hide(); }); $("#btnHideWithAttr").on("click",function(){ $("[id='btnOK']").hide(); }); $("#btnReload").on("click",function(){ $("[id='btnOK']").show(); });