No, there is no property that allows you to do this with HTML only. With javascript you can apply this behavior. It seems like the best way to remove an attribute list=from inputif you don't need a datalist.
Here is a jQuery example that does what you need:
I added an attribute data-listwith a copy of the attribute listto make it easier to recover after entering more than two characters.
$('input[list]').on('input', function(e) {
var input = $(e.target),
datalist = input.attr('data-list');
if(input.val().length < 3) {
input.attr('list', '');
} else {
input.attr('list', datalist);
}
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<input list="myList" data-list="myList">
<datalist id="myList">
<option value="option 1">
<option value="option 2">
</datalist>
Run codeHide result