Zaiton Zaiton - 2 months ago 7
Javascript Question

Setting the value of an imput box - Javascript

I'd like to know how to manually set a value to that box, similar to how I'd write it on the keyboard. The box itself doesn't have an ID so I can't use

getElementById.value
or
.innerHTML
so I'm kinda stuck.

Here's a picture for reference.
http://i.imgur.com/zxKkf1w.png

Basically what I want to do is go to console and set the value of that box equal to 123 for example, without having to click on it with my mouse and type it on the keyboard. Something like
getElementByID.value = 15
for instance.

Thank you

Answer

Try this

$('*[data-resource="wood"]').val(the_value)