因此,基本上,我正在创建一个简单的队列管理系统项目,负责管理队列号。总之,我创建了一个包含4个自定义队列号的简单列表,并将其放置在“等待队列号”下。部分。当我单击其中一个时,它们将向我显示警报,然后单击的号码将移动到“当前服务编号”中。清单。我是JavaScript和Razor Pages的新手,我很难找到解决方案。如果有人可以帮助我解决这个问题,那就太好了
@page
@model Admin2.Pages.Center1.Counter1Model
@{
List<string> numbers = new List<string>() {
"A034", "E089", "E056", "A078"
};
}
<style>
div {
font-size: 120%;
}
.row input-group {
padding: 10px 32px;
}
</style>
<div class="container">
<div class="row">
<div class="col">Waiting Queue No.</div>
<br />
<div class="col ml-5">Currently Serving</div>
<div class="container">
<div class="row" id="1">
</div>
<div class="row" id="2">
</div>
<div class="row" id="3">
</div>
<div class="row" id="4">
</div>
</div>
</div>
@foreach (var number in numbers)
{
<button class="row" id="number">@number</button>
<br/>
}
<br />
<div class="row">
<div class="col">Missed Queue No.</div>
</div>
</div>
<script>
document.getElementById("number").addEventListener("click", function () {
alert("You have just called for this number");
});
</script>