0

I want to know if there's a way on customizing the button's text when a alert appears. An alert is like this

<!DOCTYPE html>
<html>
<body>
<script> function functionAlert() {
   alert("the text will be "Okay" but is there a way to make it something else?")
}
<script>

<button class=".button .button1" onclick="functionAlert"()>button!</button>

</body>
</html>

Aziz
  • 1
  • 3
  • 1
    What do you mean by "customize?" – Spectric Jul 29 '21 at 19:47
  • As in when you click a button that shows an alert and it has the button that says "Okay" to close it, is there a way to change that text from "Okay" to something else? – Aziz Jul 29 '21 at 19:48

2 Answers2

1

This question are duplicated.

You can't change the text of the button but you can try jquery script in this link of duplicated question.

Javascript : custom text on Confirm Ok Cancel button

José Augusto
  • 131
  • 1
  • 8
0

You can not customize the alert box, however, you can create your custom pop up or modal box to do that. Here is a post for more information.

Nikkkshit
  • 460
  • 3
  • 11