Empêcher la sélection d'un élément
Bonjour,
Je suis en train de me créé un petit clavier virtuel.
Mon problème viens que lorsque je clique sur une touche, un curseur de saisie apparaît. Comment empêcher ce phénomène?
Voici mon code d'essais:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
| <!DOCTYPE html>
<html lang="">
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<header></header>
<main>
</main>
<footer></footer>
</body>
<style>
.VirtKey{
position:fixed;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
display: grid;
grid-template-columns: repeat(4, 1fr);
gap:0.2em;
border:0.2em;
border-color:black;
padding:0.2em;
border-radius: 5px;
background-color: rgb(207,232,220);
border: 2px solid rgb(79,185,227);
}
.VirtKey_Touch{
min-width:1cm;
min-height:1cm;
background-color: rgb(207,232,220);
display: flex;
align-items: center;
justify-content: center;
font-size:0.8cm;
}
</style>
<script type="text/javascript">
class VirtKey {
constructor(){
this.ctVirtKey=document.createElement('div')
document.body.appendChild(this.ctVirtKey);
this.ctVirtKey.classList.add('VirtKey','VirtKey_Touch')
this.ctVirtKey.innerHTML= 'Touche'
}
}
inst = new VirtKey()
</script>
</html> |
En vous remerciant par avance pour le temps que vous voulez bien m'accorder.