<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Punjab</title>
<link rel="stylesheet" href="CV2.css">
<script src="./keyin.js"></script>
</head>
<body>
<div class="side-bar">
</div>
<script type="text/javascript" src="./cv2.js"></script>
</body>
</html>
table += "</table>";
document.querySelector("side-bar").innerHTML = table ;
您正在使用QuerySelector
在使用类选择器时使用点
document.querySelector('.side-bar').innerHTML = "your value"