JSFiddle - React, Tailwind, and code Playground

by huppen

HTML

<div id="this">Klick</div>
<div id="panel" style="position: absolute; left: 190px; top: 300px; width: 400px; height: 300px; border: medium groove brown; background: none repeat scroll 0% 0% black; z-index: 100; color: white;">
    <form id="form_coord_0">  
        X <input type="text" name="X" id="coordX_0"/>  
        Y <input type="text" name="Y" id="coordY_0"/>  
        <input type="button" name="edit" id="edit_0" value="M"/>  
        <input type="button" id="remove_0" value="-"/>  
        <input type="button" id="add_0" value="+"/>  
        <input type="button" id="go_0" value="go!"/>  
        <br/>
    </form>
</div>

JavaScript

$(function () {
		function fillform(){
    var inputs_to_values = {
        'X' : 'some value',
        'Y' : 'some other value',
        'edit'   : 'N',
        'remove_0' : '_',
        'add_0'    : '-',
        'go_0'     : 'stop?'
    };
    $('form').find('input').val(function () {
        return inputs_to_values[this.name];
    });
    }
    $("#this").on("click", function(){
    	fillform();
    });
});