470,849 Members | 1,258 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,849 developers. It's quick & easy.

I need to make buttons work and dont know how

So i have this code here:
Expand|Select|Wrap|Line Numbers
  1.     let submitButton = document.querySelector("#btn");
  2.     let myAddList = document.querySelector("#addList");
  3.  
  4.     submitButton.addEventListener("click", submitFunction);
  5.      function submitFunction(){
  6.  
  7.         let getName = document.querySelector("#firstName").value;
  8.         let getLastName = document.querySelector("#lastName").value;
  9.         let getNumber1 = document.querySelector("#number1").value;
  10.         let getNumber2 = document.querySelector("#number2").value;
  11.         let getNumber3 = document.querySelector("#number3").value;
  12.         let getDate = document.querySelector("#date").value;
  13.         let getID = document.querySelector("#id").value;
  14.  
  15.  
  16.  
  17.             myAddList.innerHTML += "<li style='list-style:none'>Name: "+getName+"<br> "+ "Last name: " + getLastName +
  18.              "<br>" + "Phone number: " + getNumber1 + " " + getNumber2 + " " + getNumber3 + "<br>" + "Birth date: " + getDate + "<br>"
  19.              + "ID: " + getID + "<br>" + "<button id='accept'  >Accept</<button>" + 
  20.               "<button id='denied'>Denied</button>" + "</li>";
  21.  
  22.  
  23.  
  24.         document.querySelector("#form").reset();
  25.     }
which lets me add student info with one button. Now the thing is that every new student list has to have 2 buttons accept and denied which are only visible if i hover onto the particular list of students.How can i make that work?
4 Weeks Ago #1
1 8594
dev7060
575 Expert 512MB
Now the thing is that every new student list has to have 2 buttons accept and denied which are only visible if i hover onto the particular list of students.How can i make that work?
You may use hover pseudo-class and toggle the visibility using the display property.
3 Weeks Ago #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

6 posts views Thread by Chris Krasnichuk | last post: by
20 posts views Thread by Chris Krasnichuk | last post: by
7 posts views Thread by Ron | last post: by
21 posts views Thread by stephenrussett | last post: by
2 posts views Thread by Sreenivas | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.