Input Email placeholder Property - Get the placeholder text of an email field: - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Input Email field

Description

Input Email placeholder Property - Get the placeholder text of an email field:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>
Login: <input type="email" id="myEmail" placeholder="Email">

<button onclick="myFunction()">Test</button>

<p id="demo"></p>

<script>
function myFunction() {//from   w ww  .  ja v a2  s  . c o m
    var x = document.getElementById("myEmail").placeholder;
    document.getElementById("demo").innerHTML = x;
}
</script>
</body>
</html>

Related Tutorials