try js ref_doc_getelementsbyClassName
“Uncaught TypeError: Cannot set property ‘value’ of null “
This HTML code
<input type="text" class="form-control" class="test" />
This JS code
function inputtest() { document.getElementsByClassName('test').value = selectedControl; }
Advertisement
Answer
Change your html:
<input type="text" class="form-control test" />
JS
function inputtest() { document.getElementsByClassName('test')[0].value = selectedControl; }