JSFiddle - React, Tailwind, and code Playground

by r3wt

HTML

<select id="selectMP" name="mjesto_potrosnje" onload="changePic()" onchange="changePic()">
    <optgroup label="Company1" id="0">
        <option value="getData('[email protected]','0','3210949','32109491','1')">
                Info 1
        </option>
        <option value="getData('[email protected]','0','3210949','32109491','2')">
                Info 2
        </option>
        <option value="getData('[email protected]','0','3210951','32109511','1')">
                Info 3
        </option>
        <option value="getData('[email protected]','0','3210951','32109511','2')">
                Info 4
        </option>
        <option value="getData('[email protected]','0','3210951','32109511','3')">
                Info 5
        </option>
        </optgroup>
</select>

JavaScript

window.changePic = function(){
	eval(document.getElementById('selectMP').value);
}

window.getData = function(a,b,c,d,e){
	console.log(arguments);
}