2 accessingelements

2
Accessing Elements: accessingelements.html <!doctype html> <html> <head> <title>Learning Javascript</title> <meta charset="utf-8" /> <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> </head> <body> <p id="text">Some text</p> <script type="text/javascript"> // This is a comment /*

description

access

Transcript of 2 accessingelements

Page 1: 2 accessingelements

Accessing Elements: accessingelements.html !!<!doctype html>

<html>

<head>

<title>Learning Javascript</title>

<meta charset="utf-8" />

<meta http-equiv="Content-type" content="text/html; charset=utf-8" />

<meta name="viewport" content="width=device-width, initial-scale=1" />

</head>

<body>

<p id="text">Some text</p>

<script type="text/javascript">

// This is a comment

/*

Page 2: 2 accessingelements

This is a multi-line

comment

*/

document.getElementById("text").innerHTML="Some more text";

</script>

</body>

</html>