javascript prompt

 1.  <!DOCTYPE html>

<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <h1   style="color: blue; background-color: black;" id="s">HELLO</h1>
 
       
   <script src="index.js"></script>
</body>
</
html>


1.javascript
function fun(){
  var name =  prompt('what is your name');
  var result = 'hello ' + '' + name;
  console.log(result);
  document.getElementById('s').innerHTML = result;
}
fun();



No comments:

Post a Comment

Aswinkl71

Navbar

  < nav class = "navbar navbar-expand-lg navbar-dark bg-dark fixed-top" >   < div class = "container" >   ...