How do I update an html input field using the DOM? Here's what I've tried using the getElementsByClassName method:
<input type="number" class="price_input price_input_now" placeholder="Price in USD">
<script>
function myFunction() {
document.getElementsByClassName("price_input price_input_now").setAttribute = "Some text";
console.log("btn clicked");
}
</script>
click
The function is getting called - the console.log("btn clicked") is working. I tried .innerHTML, .innerText, and .setAttribute so far.
thanks!!