I'm having a problem, getting & when set value of a input element by an element innerHTML this the element that i'm gonna take the innerHTML.
<div class="item">Printer & Scanner</div>
Then when i set the input value
inputElement.value = itemElement[x].innerHTML
The value became Printer & scanner. I also try using the setAttribute('value', 'Printer & Scanner'); and still get the same result. It make the input looks ugly because & showing in the input element. When i console.log(itemElement[x].innerHTML) the result is normal.
Is there any way that i can do to convert them? i already searching but found nothing.
Thanks