JavaScript

ALERTボタンをクリックするとalertダイアログが表示される(JS)

ソース
<script>
window.onload=function(){
var button=document.getElementById('button');
button.onclick=aler;
}
function aler(){
var ale="alert";
alert(ale);
}
</script>
<body>
<button id="button">alert<button>
</body>
結果