Dear @Web cifar, Thank you for this video. This was really usefuld :) It works for me when I modify according to my needs, though when I try to create a second box. I've duplicated the classes, divs/h2-s (e.g., content 2 etc.) and every field. Everything works even popups but when it comes to copytoclipboard function --> select part, it's throwing the following error: Uncaught TypeError: textarea2.select is not a function This is the script I used: const text2 = document.querySelector(".content2 h2"); const popup2 = document.querySelector(".popup2"); text2.addEventListener("click", () => { popup2.classList.add("active"); copyToClipBoard2(); }); popup2.addEventListener("animationend", () => { popup2.classList.remove("active"); }); function copyToClipBoard2() { const textarea2 = document.createElement("textarea2"); textarea2.setAttribute("readonly", ""); textarea2.value = text2.innerText; textarea2.select();
} do you have any idea why? :) Thaank you in advance! :)
Though the problem was you tried to create an element and you passed the type textarea2. This is not an valid element type. You need to create the element with textarea. const textarea2 = document.createElement(“textarea”);
tell me not lol, you are a great hacker in JavaScript lmao. can you copy the code im typing ? hahaha, thank you for the video man, inspired me to become a hacker for the underground
Source Code : codepen.io/Web_Cifar/pen/ExPdKRG
Thanks for watching ❤✌👍
It's really good Sir. Nice explanation.
Thanks
Wow Really Amazing Video, it’s very helpful for the beginners of javascript.
Thank You Very Much.
Take Love from Bangladesh🥰
bye bye khuda hafiz
excellent job
Love these challenges. Thank you so much for putting them together!
Glad you like them!
Now I learned phising
Nice work thank u so much!
Welcome
It's amazing ... ❤😎
Thank you.
Hello. What's the software you use to edit the sites?
Dear @Web cifar,
Thank you for this video. This was really usefuld :)
It works for me when I modify according to my needs, though when I try to create a second box.
I've duplicated the classes, divs/h2-s (e.g., content 2 etc.) and every field.
Everything works even popups but when it comes to copytoclipboard function --> select part, it's throwing the following error:
Uncaught TypeError: textarea2.select is not a function
This is the script I used:
const text2 = document.querySelector(".content2 h2");
const popup2 = document.querySelector(".popup2");
text2.addEventListener("click", () => {
popup2.classList.add("active");
copyToClipBoard2();
});
popup2.addEventListener("animationend", () => {
popup2.classList.remove("active");
});
function copyToClipBoard2() {
const textarea2 = document.createElement("textarea2");
textarea2.setAttribute("readonly", "");
textarea2.value = text2.innerText;
textarea2.select();
}
do you have any idea why? :)
Thaank you in advance! :)
I prefer this new web api instead of this old method. Check it out. You will like it too. developer.mozilla.org/en-US/docs/Web/API/Clipboard_API
Though the problem was you tried to create an element and you passed the type textarea2. This is not an valid element type. You need to create the element with textarea.
const textarea2 = document.createElement(“textarea”);
@@webcifar Thank you so much for your help :) it workeeeeeed!!!!!!
Sorry, I just started this scripting a week ago, so I'm quite new :)
Thank you it's great but how can l use it more than once within the same page?? Sorry I'm a js beginner
@@NorthTonawanda1oh that would be great thank you +good luck with it 😄
Ótimo vídeo parabéns 👏.
Muito obrigado 🙏✌
That's so cool!
Thanks Brother ❤
Whats the software called?
tell me not lol, you are a great hacker in JavaScript lmao. can you copy the code im typing ? hahaha, thank you for the video man, inspired me to become a hacker for the underground
Obrigada