Input Search readOnly Property - Find out if a search field is read-only or not: - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Input Search

Description

Input Search readOnly Property - Find out if a search field is read-only or not:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>
Search: <input type="search" id="mySearch" readonly>

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

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

<script>
function myFunction() {//w  ww  .j av  a  2  s  .c  om
    var x = document.getElementById("mySearch").readOnly;
    document.getElementById("demo").innerHTML = x;
}
</script>

</body>
</html>

Related Tutorials