Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

149
Views
How can I handle events in Modular JS files?

My HTML code:

<div class="modal fade" id="SignUpModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
    <div class="modal-dialog">
      <div class="modal-content">
        <div class="modal-header">
          <h5 class="modal-title" id="exampleModalLabel">SignUp</h5>
          <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
        </div>
        <div class="modal-body">
          <input type="email" placeholder="Enter your email" id="newuseremail">
          <input type="password" placeholder="Enter Password Here" id="newuserpassword">
        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-secondary signupbtn" data-bs-dismiss="modal">SignUp</button>
          <button type="button" class="btn btn-primary">Close</button>
        </div>
      </div>
    </div>
  </div>

MY JS Code:

import { createUserWithEmailAndPassword } from 'firebase/auth';




console.log("helossssss");

let signupbtn = document.querySelector('.signupbtn');
signupbtn.addEventListener('click', (e) => {
    console.log(e);
    // e.preventDefault();
    let email = document.querySelector('#newuseremail');
    let password = document.querySelector('#newuserpassword');
    console.log("Heelo World")

    createUserWithEmailAndPassword(auth, email, password)
        .then((userCredential) => {
            let user = userCredential.user;
            console.log(user);
            email.value = "";
            password.value = "";
        })
        .catch((err) => {
            console.log(err);
        })
})

I want to authenticate users using firebase and as per firebase 9.6.2 which uses modular approach,I have made my JS script a module.But the browser console doesnt seem to work here....

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!