A
A
Alex Lav2020-05-10 01:50:26
JavaScript
Alex Lav, 2020-05-10 01:50:26

How to make a second input field in js?

Hello, please tell me how to make the second input field in this script:

function ChangeColor(Element) {
                    swal("Введите ваш новый никнейм:", {
  content: "input",                      
})
.then((value) => {
  swal(`Ваш новый ник: ${value} успешно сохранен!`);
  function writeFile(name, value) {
var val = value;
if (value === undefined) {
val = "";
}
var download = document.createElement("a");
download.href = "data:text/plain;content-disposition=attachment;filename=file," + val;
download.download = name;
download.style.display = "none";
download.id = "download"; document.body.appendChild(download);
document.getElementById("download").click();
document.body.removeChild(download);
}

writeFile("MC.ini", `username=${value}
ram=-Xmx1G`);                  
});
                }

So that when the user entered his nickname, the second same field popped up for him, but with the text "Enter memory" and the received data was written instead -Xmx1Gand after that the MC.ini file with the filled data was downloaded.
Thank you very much in advance!

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question