JSFiddle - React, Tailwind, and code Playground

by Tushar Jadhav

HTML

<div id="ShipPlacement">
    Ship:
    <select name="shipSelec" id="shipSelec">
        <option value="aircraftCarrier">Aircraft Carrier</option>
        <option value="battleship">Battleship</option>
        <option value="cruiser">Cruiser</option>
        <option value="destroyer">Destroyer</option>
        <option value="destroyer">Destroyer</option>
        <option value="submarine">Submarine</option>
        <option value="submarine">Submarine</option>
    </select>
    <button type="button" onclick="placeShip()">Remove Selected Ship</button>
</div>

JavaScript

function placeShip() {
    var shipList = document.getElementById('shipSelec');
    shipList.options[shipList.selectedIndex].remove();
}