I want to change span value to <span class='tag'>test_succeed</span>,
I tried "input" but it doesn't work, any idea ?
<span class="tag" id="tag-option">
<input type='hidden' name='tag-value' value='' id="test-input">
<span class="close"></span>
</span>
<script>
document.getElementById('test-input').value = "test_succeed";
</script>
hiddenso it might be related.test_succeedto the span, you can uselet span = document.getElementById('tag-option'); span.innerText = 'test_succeed';