Click here to Skip to main content
15,867,986 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello, I'm trying to pass this HTML element so I could use it in the backend of my express/node app.

<label class="checkbox" for="myCheckboxId">
<input class="checkbox__input" type="checkbox" name="myCheckboxName" id="myCheckboxId">
<div class="checkbox__box"></div>
</label>

How can I use this element in the index.js file of my express app?
I try to create the element in both the index.html file and the app.js (the js frontend) but I couldn't get this element in my backend where I will need to do some operations with this element. Anyone can help?

What I have tried:

Tried to render the file from JS (app.js). I could do that but I couldn't interact with server side.

Tried to take the element and send it to index.js, but I got an undefined value i.e. checkbox variable didn't get the data I would need.
Posted
Updated 3-Jul-22 4:06am
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900