ACCESSES
#) How to accesses <html > inside <script> -:
step1 provide id attribute ( all tags) ex. <p id="f1"> msg </p>
step2 using syntax:-
getElementById("id")
ex.
<p id="f1">msg</p>
document.getElementById("f1")
ex.
of using document.getElementById
in inner html
<html>
<head>
<script language="JavaScript">
function display()
{
var a=10;
document.getElementById("p1").innerHTML="Welcome";
document.getElementById("p2").innerHTML=a;
document.getElementById("p3").innerHTML=50+60-6;
}
</script>
</head>
<body>
<p id ="p1"> </p>
<br>
<p id="p2"> </p>
<br>
<p id="p3"> </p>
<button onclick="display()">click</button>
</body>
</html>
# TEXT box working:- ALL text box data is to be accessed in the form of value
Comments
Post a Comment