<form>
<label for="urlInput">Enter a URL:</label>
<input type="url" id="urlInput" name="urlInput" required>
<button type="submit">Submit</button>
</form>
type="url"
: This input type forces the browser to validate the input as a URL.- Native Browser Validation: The browser provides validation feedback, preventing the form from submitting if the URL is invalid.