This is input:
<input type="text" id="name" maxlength="10" required placeholder="Enter Username">
And this is Javascript:
contactsRef.child("users/" auth.uid "/moath")
.set({ a1: $('#name').val(),})
In JavaScript i have /moath I don't want it.
But I want to set child name from input
I have tried this:
contactsRef.child("users/" auth.uid "/('#name')")
.set({ a1: $('#name').val(), })
I've looked at this too but it wasn't helpful
CodePudding user response:
If I correctly understand your question, you need to do:
contactsRef.child("users/" auth.uid "/" $('#name').val())
.set({ a1: $('#name').val()});