<!-- JS event : onblur Execute a JavaScript when a user leaves an input field: The onblur event occurs when an object loses focus. --> Enter Name <input type = text id = "f" onblur = myfunction();> <script> function myfunction() { var x = document.getElementById("f"); x.value = x.value.toUpperCase(); } </script>
Posts
Showing posts with the label java script
- Get link
- X
- Other Apps
<!-- javaScript variables can hold many data types: numbers, strings, arrays, objects and more: --> <script type="text/javascript"> var n = 10; // n is number datatype document.write(n,"<br>"); </script> <script type="text/javascript"> //strings datatype var s = "Rohit"; // s is strings datatype document.write(s,"<br>"); </script> <!--arrays datatype--> <p id = "demo"></p> <script> var a = ["Bumrah", 'arrsys', 123, 12.12]; document.getElementById("demo").innerHTML = a[0]; </script> <!--object datatype --> <script type="text/javascript"> var x = {firstname:"milan", secondname:"bakotra"};//x is object document.write(x.firstname," ",x.secondname, "<br>");//firstname and second name is properties </script>