HTML Input: Require URL to end in specific filetype : <p>How can I make a URL Input form require the input to be both a valid URL, and end in a specific filetype.</p>

<p>For example, this is my input:</p>

<p><code>&lt;input name="bg" placeholder="https://website.com/image" type="url"&gt;</code></p>

<p>As you can see, It is using the URL type, which restricts it to a valid http:// domain, but I would like the input field to only accept .png, .jpg, and .gif files.</p>

<p>Can this be achieved through html or javascript, and if so, how?</p>

<p>Thanks!</p>
