JSFiddle - React, Tailwind, and code Playground

HTML

<div class="container" id="addCell">
    <form id="acForm"method="POST" action="<?php echo URL; ?>Cell/addCell">
        <ul>
            <li>
                <p>
                    <label>Name</label>
                    <input type="text" name="name"class="longInput1"/>
                <p>
                <p>
                    <label>City</label>
                    <select id="countrySelector" name="city">
                    </select>
                </p>
            </li>
            <li id="intersectionCells">
                <select>
                    <option>Select Cell</option>                       
                    <option value="aasd"> sdfdsf</option>                       
                </select>
                <span></span>
                <p>
                    <label>Inserted cells</label>
                    <a href="#" class="smallLink" id="acaclink">new</a>
                </p>
            </li>
            <li>
                <input type="submit" class="button1" value="save"/>
            </li>
        </ul>
    </form>
</div>

JavaScript

$("#addCell").ready(function(){
    $("#addCell").on('click',"#acaclink",function(){
        var me = this;
        var cityName = $("#countrySelector").val();
        $.getJSON("http://localhost/Mar7ba/Cell/getCellsInCity/"+cityName+"/TRUE",function(data){
            var options = '';
            options+="<option>Select Cell</option>";
            for(var i=0;i<data.length;i++){
                options += "<option>"+data[i]+"</option>";
            }
            $(me).closest('li').append('<p>\n\
            <label>Select Cell</label>\n\
            <select name="acSelect[]">\n\
             '+options+'\n\
</select>\n\
<a href="#" class="removeA">delete</a>\n\
<span class="errorMessage"></span>\n\
</p>');
        });
    });
});
$("#addCell").ready(function(){
    $("#addCell").on('click',".removeA",function (){
        $(this).closest('p').remove();
    });
});
$("#addCell").ready(function (){
    $("#countrySelector").change(function (){
        var cityName = $("#countrySelector").val();
    });
});

$("#addCell").ready(function (){    
    $("#acForm").on('submit',function (e){
       
        var errorCount = 0;
        $('span.errorMessage').text('');
        $('#intersectionCells select').each(function(){
            var $this = $(this);
            if($this.val() === 'Select Cell'){
                var error = 'Please select a cell' ; // take the input field from label
                $this.next('span').text(error);
                errorCount = errorCount + 1;   
            }
        });
        if(errorCount==0){
            $(this)[0].submit(); // submit form if no error
        }
        e.preventDefault();
    });
});