Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Button not aligned after click

TheLazyPig

Programmer
Sep 26, 2019
106
PH
Hi!

I have 3 buttons visible
View attachment 1551
If I click Add button only Add button should be visible.
View attachment 1552
Then If I click back the Add button it will display all
View attachment 1553
But after I click it back the other button is not aligned.

JavaScript:
function addBank(polno){
    
    var editbtn = document.getElementById("btnEdit");   
    var selectbtn = document.getElementById("btnSelect");   
    
    if (document.getElementById("addNewRow").style.display=='none') {
           document.getElementById("addNewRow").style.display = 'table-row'; // set to table-row instead of an empty string

        selectbtn.style.display = "none"; // Hide button
        editbtn.style.display = "none"; // Hide button
     }
     else {
          document.getElementById("addNewRow").style.display = 'none';
          
        selectbtn.style.display = "block"; // Show button
        editbtn.style.display = "block"; // Show button
     }
}

What could be the reason why it is not aligned?

Thank you for the answers :D
 

Part and Inventory Search

Sponsor

Back
Top