Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function lockedProfile() {
- let AllElement= document.querySelectorAll('.profile');
- for (const element of AllElement) {
- let currentbtn= element.querySelector('.profile button');
- currentbtn.addEventListener('click',()=>{
- const lockedRadio= element.querySelector('input[type=radio][value=lock]')
- const hiddeninfo= currentbtn.previousElementSibling;
- if(!lockedRadio.checked){
- if(currentbtn.textContent =='Hide it'){
- hiddeninfo.style.display='none';
- }
- else{
- hiddeninfo.style.display='block';
- currentbtn.textContent='Hide it';
- }
- }
- })
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement