Find out if an email field is read-only:
var x = document.getElementById("myEmail").readOnly;
Click the button to find out if the email field is read-only.
<!DOCTYPE html> <html> <body> E-mail: <input type="email" id="myEmail" readonly> <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() {/* w ww. j av a2 s .c o m*/ var x = document.getElementById("myEmail").readOnly; document.getElementById("demo").innerHTML = x; } </script> </body> </html>