JSFiddle - React, Tailwind, and code Playground
by f0t0n
HTML
<h4>Article form</h4>
<form id="article-form" method="post">
<label>Title:</label>
<input name="title" type="text" />
<label>Text:</label>
<textarea name="text"></textarea>
<input type="submit" name="submit" value="Comment" />
</form>
<hr />
<h4>Support form</h4>
<form id="support-form" method="post">
<label>Title:</label>
<input name="title" type="text" />
<label>Text:</label>
<textarea name="text"></textarea>
<input type="submit" name="submit" value="Submit issue" />
</form>
<script type="text/javascript">
var article = document.getElementById('article-form'),
ticket = document.getElementById('support-form');
article['title'].value = 'My Article';
article['text'].value = 'The text of my article...';
ticket['title'].value = 'I found bug at your site';
ticket['text'].value = 'Bug description...';
</script>
CSS
label, input, textarea {
display: block;
margin: 5px;
}
h4 {
margin: 5px;
}