Jason Xiao Jason Xiao - 2 months ago 9
Javascript Question

If we can invoke browser prompt dialog box with multi inputs fields and custom note?

People say we cannot customize DOM prompt box, but I have seen servers like xampp admin login page provide multi inputs dialog box. If we can make our own?

For example like this one

Answer

You can't manipulate the browsers prompt, but you can create your own custom prompt easily. Here's a dummy for you:

#foo {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translateX(-50%) translateY(-50%);
  background-color: gray;
  padding: 30px;  
}
<div id="foo">
  <p>
    Jolly rogers hobble from graces like big plunders.
  </p>
  <p>
    To the sour lettuce add celery, herring, coconut milk and cored zucchini.
  </p>
  <input >
  <input >
  <button>
    Click me!
  </button>
</div>