JSFiddle - React, Tailwind, and code Playground

by AziziMusa

HTML

<div class="window task" style="left: 120px; top:200px; display:block;" data-nodetype="task" id="taskcontainer0">
        <div class="ctrl_container">
            <div class="button_remove">x</div>
        </div>
        <div class="details_container">
            <form id="myForm">
            <label class="detail_label">Name</label>
            <input id="title" type="text" class="detail_text" name = "diagram.task.Title[]" value="yes"/><br/>
            <label class = "detail_label">Description</label>
            <input id="msg" type="text" class ="detail_text" name = "diagram.task.Msg[]" value="no">
                </form>
        </div>
    </div>
    <pre class="result"></pre>
    <pre id="json"></pre>

JavaScript

var title = $('#title').val();
var msg = $('#msg').val();
$('.result').text(title+"\n"+msg);

var form = $('#myForm').serializeArray();
var json = JSON.stringify(form);
$('#json').text(json);