JSFiddle - React, Tailwind, and code Playground

by bohdantheone

HTML

<form action="" method="post" id="addnews" name="addnews">   
    <input type="button" name="form[mod]" value="addnews" >
    <input name="ok" type="submit" class="buttons" value="&nbsp;&nbsp;Добавить&nbsp;&nbsp;">
</form>

<script language="JavaScript">

document.forms.addnews.elements[0].value="preview"; // Значение первого элемента

</script>