Profile Picture Selection

HTML

<form>
    Choose a Profile Picture:<br>
    <select id="profilePictureType" onchange="onSelectChange()">
        
        <option value="1">Upload an Image
        <option value="2">Load from URL
            
    </select><br>
            
    <input type="file" id="fileBrowse" accept="image/*"><br>
    <input type="url" id="enterUrl" placeholder="Enter in a URL." disabled="disabled">
        
</form>

CSS

input {
    margin-top: 10px;
}

select {
    margin-top: 10px;
}

JavaScript

function onSelectChange() {
    var selectedValue = document.getElementById("profilePictureType").value;    
    selectedValue == "1" ? upload() : link();
}

function upload() {
    document.getElementById("enterUrl").disabled = true;
    document.getElementById("fileBrowse").disabled = false;
    
}

function link() {    
    document.getElementById("fileBrowse").disabled = true;
    document.getElementById("enterUrl").disabled = false;
}