<!DOCTYPE html>
<html>
<head>
<script type="text/javascript">
function htmlonload(){
changeText("MyText", "text changed");
}
function changeText(id, text){
document.getElementById(id).innerHTML = text;
}
</script>
<meta charset="UTF-8">
<title>Test Text: Javascript to change text</title>
</head>
<body onload="htmlonload();">
<h1>Test Text: Javascript to change text</h1>
<div id="MyText">Hello All</div>
</body>
</html>
Output:
No comments:
Post a Comment