[html] Is it possible to change the content HTML5 alert messages?

Is it possible to control HTML5 alert messages? when adding 'required' to an input field.

because I want it to be specific and I don't want it's language to depend on the browsers.

<input id="answer" required> 

This question is related to html html5

The answer is


Yes:

<input required title="Enter something OR ELSE." /> 

The title attribute will be used to notify the user of a problem.


You can use customValidity

$(function(){     var elements = document.getElementsByTagName("input");     for (var i = 0; i < elements.length; i++) {         elements[i].oninvalid = function(e) {             e.target.setCustomValidity("This can't be left blank!");         };     } }); 

I think that will work on at least Chrome and FF, I'm not sure about other browsers