0
I was trying to make an html page using javascript, but nothing happens, I put the script inside the body, Linkei the bootstrap and everything. However, it doesn’t work, someone help me please.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="bootstrap.css">
</head>
<body class="d-block justify-content-center m-0">
<script type="text/javascript">
const title = document.createElement("h1");
title.innerHTML = "My title";
const divcominput = document.createElement("div");
divcominput.classList.add('container');
divcominput.classList.add('justify-content-center');
divcominput.classList.add('d-block');
divcominput.classList.add('bg-dark');
const inputdadiv = document.createElement("input");
inputdadiv.type = Text;
inputdadiv.placeholder = 'Nome completo';
divcominput.append(inputdadiv);
divcominput.append(title);
</script>
</body>
</html>
Syntax error on lines
const title = document.createElement(h1)
,const divcominput = document.createElement(div);
andconst inputdadiv = document.createElement(input);
.Place the parameters in quotes:const title = document.createElement("h1")
,const divcominput = document.createElement("div");
andconst inputdadiv = document.createElement("input");
– Augusto Vasques