-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path2z.html
23 lines (22 loc) · 864 Bytes
/
2z.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<!DOCTYPE html>
<html lang="en">
<head>
<title>JS Tutorials 201</title>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<h1>JavaScript Template Strings</h1>
<p>Templates allow variables in strings:</p>
<p id="target"></p>
<p>Templates are not supported in Internet Explorer.</p>
</body>
<script>
let firstWord = "Integrated";
let lastWord = "Circuit";
let abbreviation = `${firstWord[0]}${lastWord[0]}`;
let txt = `An <b>${firstWord} ${lastWord}</b> which is abbreviated as an <b>${abbreviation}</b> is an electronic device or component.`;
document.getElementById("target").innerHTML = txt;
</script>
</html>