JavaScript:Document Object Model

From virtualMV2015wiki
Jump to: navigation, search
 Home  JavaScript <

Introduction

Overview

Icon Objectives.png

Objectives

By the end of this page you will be able to:

getElementById

<html>
<head>
<title>getElementById Example</title>
<style>
.displayInfo 	{
       width: 300px; height: 50px; border: 1px solid #808080;
       margin-right:auto;margin-left:auto; background-color: #F6F9ED;
       font-weight: bold; cursor: pointer;}
</style>
<script type="text/javascript">
function fnX(){
  document.getElementById('ShowInfo').innerHTML = "YYY";
	}
</script>
</head>
<body>
<div id="ShowInfo" class = "displayInfo" onClick="fnX();">XX</div>
</body>
</html>

Resources

Koch, P.-P. (2007). JavaScript - W3C DOM - Introduction. Retrieved June 14, 2009 from http://www.quirksmode.org/dom/intro.html

Icon References.png References


JavaScript:Document Object Model. (2017). In virtualMV's ( Michael Verhaart ) wiki. Retrieved December 17, 2017, from http://www.virtualmv.com/wiki/index.php?title=JavaScript%3ADocument_Object_Model    (zotero)