Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Vital-Vuillaume committed Aug 2, 2023
1 parent 8ce0d86 commit d6e6bbf
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions Uppercase-Converter.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
//------Pour que le site soit securise------\\

/*if (window.location.protocol != "https:") {
window.location.protocol="https:";
}*/

//------Element html------\\

const txt = document.querySelector(".txt");
const Maj = document.querySelector(".Maj");
const btn = document.querySelector(".btn");

//------Variable------\\

let texteMajuscule = "";

//------Mettre le texte dans l'autre partie en majuscule------\\

function txtDansTxtMaj() {
const texte = txt.value;
texteMajuscule = texte.toUpperCase();
Maj.innerText = texteMajuscule;
}

//------Quand j'écris dans sa va directement sur l'autre partie------\\

txt.addEventListener("input", txtDansTxtMaj);

//------Le bouton copier-coller------\\

btn.onclick = function() {
btn.classList.add("active");
navigator.clipboard.writeText(texteMajuscule);

setTimeout(function() {
btn.classList.remove("active");
}, 2500);
};

0 comments on commit d6e6bbf

Please sign in to comment.