How to connect mongodb to the front end using Node js

i have tried many times and failed to connect my front end with mongodb usind node js

We cannot tell you what you are doing wrong if you do not share what you are doing.

We need connection string you are using.

We need code you are using.

We need error messages you are getting.

1 Like
Form Validation using JavaScript
    <div class="container">
        <div class="header">
            <h2>Registration Form</h2>
        </div>
        <form action="register" method="post" class="form">
            <div class="form-group">
                <label for="">UserName : </label>
                <input type="text" placeholder="username" id = "username" autocomplete="off">
                <i class="ion-ios-checkmark"></i>
                <i class="ion-android-alert"></i>
                <span></span>
            </div>
            <div class="form-group">
                <label for="">Email : </label>
                <input type="text" placeholder="email" id = "email" autocomplete="off">
                <i class="ion-ios-checkmark"></i>
                <i class="ion-android-alert"></i>
                <span></span>
            </div>
            <div class="form-group">
                <label for="">Phone Number : </label>
                <input type="text" placeholder="phonenumber" id = "phonenumber" autocomplete="off">
                <i class="ion-ios-checkmark"></i>
                <i class="ion-android-alert"></i>
                <span></span>
            </div>
            <div class="form-group">
                <label for="">Password : </label>
                <input type="password" placeholder="password" id = "password" autocomplete="off">
                <i class="ion-ios-checkmark"></i>
                <i class="ion-android-alert"></i>
                <span></span>
            </div>
            <div class="form-group">
                <label for="">Confirm Password : </label>
                <input type="password" placeholder="confirm password" id = "confirmpassword" autocomplete="off">
                <i class="ion-ios-checkmark"></i>
                <i class="ion-android-alert"></i>
                <span></span>
            </div>
            <button id = 'submit'>Submit</button>
      

        <span class="text">Not a member?
            <a href="login1.html" class="text signup-link">Signup Now</a>
        </span>
    </form>
</div>
<script src="app.js"></script>

This is html code.

It does not show

1 code used to connect
2 connection string
3 error message you get