我的 onClick 按钮在我点击后已经运行了一个功能,我只是希望它在被点击后也显示一条确认消息。我只是被困住了。任何帮助是appriciated。 这是我的按钮的格式:
<button id="button" type="button" onClick={write}>
RESERVE ROOM
</button>
答案 0 :(得分:0)
只需创建一个写入函数,将消息添加到 html 元素
function write() {
const message = document.getElementById("message");
message.innerText = "This is the inserted message";
}