I have initialized firebase and want to write into database . I want unique code for every child but i am not able to do that i tried many things but i can't please help me to do this .............. codes are below tell me where i am wrong
<script src="https://www.gstatic.com/firebasejs/4.1.3/firebase.js"></script>
<script>
var rootRef = firebase.database().ref().child('user');
$('#tex').click(function(){
rootRef.set({
emailinfo:$('#emailinfo').val()
});
});
</script>