I used Javascript to darken the screen anytime I click a button and my form shows up, but my form darkens with the screen. I know f I was using CSS, I should use the :not selector but I need to know how to do it on JS. Pls can anyone help.
here is my HTML
<div id="mad" style="display: none; position: fixed; z-index: 100; left: 550px;">
<div style="color: black; position: absolute; top: 10px; background-color: red; width: 40px; height: 30px; position: absolute; right: -530px; top: -6px; border-radius: 2px; display: flex; justify-content: center; align-items: center;" >X</div>
<form action="" style="display: flex; justify-content: center; align-items: center; flex-direction: column; background: #F8573B; height: 750px; width: 500px; z-index: 100; border-radius: 30px;">
<div class="img" style="height: 250px; width: 250px; border-radius: 50%; background:url(./giit-site_files/nobody2.gif); position: absolute; top: 23px;"></div>
<div style="position: absolute; top: 300px; display: flex; justify-content: center; align-items: center; flex-direction: column;">
<input type="text" name="firstname" id="firstname" placeholder="Please input your firstname" style="margin: 10px; width: 380px; height: 25px; border-radius: 10px; border: solid black;">
<input type="text" name="lastname" id="lastname" placeholder="Please input your lastname" style="margin: 10px; width: 380px; height: 25px; border-radius: 10px; border: solid black;">
<input type="text" name="email" id="email" placeholder="Please input your email" style="margin: 10px; width: 380px; height: 25px; border-radius: 10px; border: solid black;">
<input type="text" name="course" id="course" placeholder="Please input your course" style="margin: 10px; width: 380px; height: 25px; border-radius: 10px; border: solid black;">
<input type="text" name="program" id="program" placeholder="Please input your program" style="margin: 10px; width: 380px; height: 25px; border-radius: 10px; border: solid black;">
<p style="margin: 10px;">Can't decide your program, hit the program decider button <button>HERE</button></p>
<input type="number" name="duration" id="duration" placeholder="Please input your program duration" style="margin: 10px; width: 380px; height: 25px; border-radius: 10px; border: solid black;">
<button style="width: 130px; height: 40px; border-radius: 10px; margin-top: 15px; background-color: red; border: hidden; font-size: larger; color: white;" type="submit">SUBMIT</button>
</div>
</form>
</div>
This is the html for the button
<p id="sign_up_here" onclick="myfunc1()">SIGN UP HERE</p>
This is my JS
<script>
function myfunc1(){
var mad = document.getElementById("mad")
var body = document.querySelector('body')
var nav = document.querySelector('nav')
mad.style.display = "block"
body.style.filter = "brightness(20%)"
}
</script>
I believe if there is a way to use Css not selector in JS but I've searched the internet and couldn't find. I would appreciate if anyone could help me out