Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
103
rated 0 times [  106] [ 3]  / answers: 1 / hits: 68127  / 6 Years ago, sun, july 29, 2018, 12:00:00

I have a question that I want to put an input in an alert box. What thing I have to do to create this? To make it I've to put an another tag, attrib, special properities, etc...
Thanks.
I think could be like this:





<!DOCTYPE html>
<html>
<head>
<title>example</title>
</head>
<body>
<script type=text/javascript>
alert(<input></input>);
</script>
</body>
</html>




More From » html

 Answers
27

You can't put anything in an alert box. As the name indicates, it's an alert. You might be looking for a prompt which has an input text field, or confirm to get a true / false depending on user selection.





let foo = prompt('Type here');
let bar = confirm('Confirm or deny');
console.log(foo, bar);




[#53857] Wednesday, July 25, 2018, 6 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
myakylas

Total Points: 66
Total Questions: 85
Total Answers: 95

Location: Guadeloupe
Member since Sat, Aug 22, 2020
4 Years ago
myakylas questions
Thu, Apr 28, 22, 00:00, 2 Years ago
Thu, Apr 8, 21, 00:00, 3 Years ago
Sat, Sep 19, 20, 00:00, 4 Years ago
;