なぜこれが機能しないのか理解できないようです。新しいdivを書き込むjavascript関数を起動する必要があるhrefにonclickイベントがあります。どんな助けでも大歓迎です。
私の問題は機能ではなくリンクにあると確信しています。
<html>
<head>
<title>Blah</title>
<style type="text/css">
.box {
position: fixed;
z-index: 5;
width:100%;
height:100%;
background-color: rgba(0,0,0,.8);
padding:25px 10px 25px 10px;
}
.content {
z-index: 1;
padding: 25px 15px 10px 15px;
}
</style>
</head>
<body>
<script type="text/javascript">
function test() {
document.write("<div class='box'>Box Test</div>");
}
</script>
<h1>Test Page</h1>
<div class="content">
<a onclick="javascript:test" href="#">Test Test Test</a>
</div>
</body>
</html>