Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function lockedProfile() {
- let allRadios = document.querySelectorAll('input[type=radio]');
- for (const radio of allRadios) {
- radio.addEventListener("click", function () {
- if (radio.value = "unlock" && radio.checked) { // how to work with radio buttons
- let profile = radio.parentElement;
- let buttonAboutContent = profile.lastElementChild;
- buttonAboutContent.addEventListener("click", function() {
- let hidenFields = profile.lastElementChild.previousElementSibling;
- if (buttonAboutContent.innerHTML == "Show more") {
- hidenFields.style.display = "block";
- buttonAboutContent.innerHTML = "Hide it";
- } else {
- hidenFields.style.display = "none";
- buttonAboutContent.innerHTML = "Show more";
- }
- });
- }
- })
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement