JSFiddle - React, Tailwind, and code Playground

by Timmy Willison

HTML

<select name="foo">
    <option value="alpha">alpha</option>
</select>

JavaScript

var test = 'pass';

function check_add(select_name, value) {
    if ($("SELECT[name=" + select_name + "] option[value='" + value + "']").length == 0) { 
        $("SELECT[name=" + select_name + "]").append($("<option />").text(value || '').val(value || ''));
    }
}
    try
{
    
check_add('foo', "D:\\Results\\BDS2007\\EXE\\TestEntityTransport.exe");
    
} 
    catch (e)
{
    test = 'fail, error = ' + e;
}

console.log(test);