<script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
<body>
<div class="result">ボタンを押してください</div>
<button class="button1">ボタン1</button>
</body>
$(function() {
$('.button1').click(function (e) {
let alt = e.altKey ? 'ALT+' : '';
$('.result').text(alt + 'ボタン1が押されました');
});
});
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.