How do I store just one of the div elements to a Google Firebase?

Viewed 42

I have the following HTML code:

<div class="col-md-6"> <span class="thumb thumbs-up"><i class="fa fa-thumbs-o-up" id="positive"></i></span> <small class="fw-500" id="positive-text" check>Positive</small>  </div>
                             
<div class="col-md-6" > <span class="thumb thumbs-down"><i class="fa fa-thumbs-o-down"  id="negative"></i></span> <small class="fw-500"  id="negative-text">Negative</small> </div>

So how do I store one of the following elements in JavaScript? This is my JavaScript code but I don't want to save both of the ID-s:

const positive= document.getElementById("positive").id;
const negative= document.getElementById("negative").id;

And how do I add just the selected one to db.collection? Any ideas?

0 Answers
Related