html - Control input hint -


some browsers provide hint user input field based on type of input, e.g. here type="email":

<input accesskey="e" name="email" id="email" type="email" required> 

chrome:

enter image description here

firefox:

enter image description here

my questions are:

  • are these part of spec?
  • is there way control message (the message , disable/enable it)?
  • is there way style tooltip?

this solution mozilla

var email = document.getelementbyid("mail");  email.addeventlistener("input", function (event) {   if (email.validity.typemismatch) {     email.setcustomvalidity("i expect e-mail, darling!");   } else {     email.setcustomvalidity("");   } }); 

Comments

Popular posts from this blog

Sort a complex associative array in PHP -

vb.net - How to ignore if a cell is empty nothing -

recursion - Can every recursive algorithm be improved with dynamic programming? -