Profile Picture Selection

by Jay Angelo Valmocina

HTML

<form>
    Choose a Profile Picture:<br>
    <select>
        
        <option onselect="upload()">Upload an Image
        <option onselect="link()">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 upload() {
    document.getElementById("enterUrl").disabled = true;
    document.getElementById("fileBrowse").disabled = false;
    
}

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