HTML DOMKeyboardEventmetaKeyプロパティ
HTML DOM KeyboardEvent metaKeyプロパティは、イベントを使用してメタキーが押されたかどうかに対応するブール値(true / false)を返します。
構文
以下は構文です-
booleanValueを返す −
event.metaKey
例
KeyboardEvent metaKeyの例を見てみましょう プロパティ-
<!DOCTYPE html>
<html>
<head>
<title>KeyboardEvent metaKey</title>
<style>
form {
width:70%;
margin: 0 auto;
text-align: center;
}
* {
padding: 2px;
margin:5px;
}
input[type="button"] {
border-radius: 10px;
}
</style>
</head>
<body>
<form>
<fieldset>
<legend>KeyboardEvent-metaKey</legend>
<label>Editor:
<input type="text" id="textSelect" onkeydown="getEventData(event)" autocomplete="off">
</label>
<div id="divDisplay">I Dare you to press the meta key</div>
</fieldset>
</form>
<script>
var divDisplay = document.getElementById("divDisplay");
var textSelect = document.getElementById("textSelect");
function getEventData(InputEvent) {
if(InputEvent.metaKey === true)
divDisplay.textContent = 'You are very brave!';
else
divDisplay.textContent = 'You scared enough?';
}
</script>
</body>
</html> 出力
これにより、次の出力が生成されます-
テキストフィールドに何かを入力する前に-
テキストフィールドに間違った答えを入力した後-
テキストフィールドに正解を入力した後-
-
HTML DOMTouchEventmetaKeyプロパティ
HTML DOM TouchEvent metaKeyプロパティは、タッチイベントが発生したときにメタが押された場合の状態に対応するブール値を返します。 以下は構文です- ブール値を返す-true/false touchEvent.metaKey ここでは、「 booleanValue 」は次のようになります- booleanValue 詳細 true タッチイベントが発生したときにメタキーが押されたことを定義します false タッチイベントが発生したときにメタキーが押されなかったことを定義します 注:モバイルまたはタッチアク
-
HTMLDOMビデオtextTracksプロパティ
HTML DOM Video textTracksプロパティは、ビデオのテキストトラックに関する情報を含むTextTrackListオブジェクトを返します。 構文 以下は構文です- TextTracksListオブジェクトを返す mediaObject.textTracks ビデオtextTracksの例を見てみましょう プロパティ- 例 <!DOCTYPE html> <html> <head> <title>HTML DOM Video textTracks</title> <style> &nbs