
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Question
![7-Fully explain the following code and draw all possible outputs.
<!DOCTYPE html>
<html>
<body>
<h2>JavaScript HTML DOM</h2>
<div id="main">
<p>Finding HTML Elements by Tag Name</p>
<p>This example demonstrates the <b>getElementsByTagName</b>
method.</p>
</div>
<p id="demo"></p>
<script>
const x = document.getElementById("main");
const y = x.getElementsByTagName("p");
document.getElementById("demo").innerHTML =
'The first paragraph (index 0) inside "main" is:
y[0].innerHTML;
</script>
</body>
</html>](https://content.bartleby.com/qna-images/question/ad1b3f56-a3c9-4d59-9a30-165fb680e6c9/a9ce14fa-1986-4952-9d5d-56bb47b23278/obsctuf_thumbnail.png)
Transcribed Image Text:7-Fully explain the following code and draw all possible outputs.
<!DOCTYPE html>
<html>
<body>
<h2>JavaScript HTML DOM</h2>
<div id="main">
<p>Finding HTML Elements by Tag Name</p>
<p>This example demonstrates the <b>getElementsByTagName</b>
method.</p>
</div>
<p id="demo"></p>
<script>
const x = document.getElementById("main");
const y = x.getElementsByTagName("p");
document.getElementById("demo").innerHTML =
'The first paragraph (index 0) inside "main" is:
y[0].innerHTML;
</script>
</body>
</html>
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by stepSolved in 4 steps with 3 images

Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- Implement HTML code that displays the table below. 00 00 00 00 00 0 00 00 00 00 00 00 00 00 00 00 00 88888 88888arrow_forwardList two (2) HTML inline elements. 1 <!DOCTYPE html> 2 <html> 3 <head> 4 <title>Exam 1</title> 5 </head> 6 <body> 7 <h1>Some <em>HTML</em>:</h1> 8 9 <p><strong>Great School:</strong> 10 <a href=”https://www.kutztown.xn--edu-9o0a/%3EKU</a> 11 </p><br> 1 13 <span style="font-style: italic;"> 14 Stuff I like:</span> 15 <ul 16 <li>cars</li> 17 <li>music</li> 18 <li>homework (not)</li> 19 </ul> 20 </body> 21 </html>arrow_forward<DOCTYPE><html><heal><tite><meta>head><body> <p>Chapter 1, Analyze, Correct, Improve<dr> <P>HTML stands for Hyperlink Makes Learning fun.<p><p>You use presentation software to create HTML pages.</p<PHTML9 is the latest version of HTML.</p>HTML is rendered within the desktop of an operating system.</BODY>arrow_forward
- Canvas • Add a Level Two Section Heading with "Canvas" as its content under the HTML for Part 2 • Add a Canvas element to index.html Find an example online (or from the textbook) that uses JavaScript to draw on a Canvas element o Choose one example and implement it in index.htmlarrow_forwardWrite the code necesary in javascript to create a webpage that contains a contact form like the one in the attatched picture. To create and style this form, copy the following HTML and CSS code exactly as follows: HTML: <form><label for="myName">Name:</label> <input type="text" name="myName" id="myName"> <label for="myEmail">E-mail:</label> <input type="text" name="myEmail" id="myEmail"› <label for="myComments">Comments:</label> <textarea name="myComments" id="myComments" rows="2" cols="20"></textarea> <input id="mySubmit" type="submit" value="Submit"› </form> CSS: form { background-color:#eaeaea; font-family: Arial, sans-serif; padding: lOpx; } label { float: left;width: 100px;clear: left; text-align: right; padding-right: lOpx;margin-top: lOpx; }input, textarea { margin-top: lOpx;display: block; }#mySubmit { margin-left: 110px; }arrow_forwardA URL (Uniform Resource Locator) is an identifier used to locate resources on the web. A URL is composed of the following components: Scheme, Host Name (with optional Port Number), Path, (optional) Query String, (optional) Anchor. These components are arranged in the following format:Scheme://Hostname:Port/Path?QueryString#AnchorFor example, in the URL "https://en.wikipedia.org:443/wiki/Kitten?printable=yes&download=no#External_links": "https" is the Scheme, "en.wikipedia.org" is the Hostname, 443 is the Port Number, "wiki/Kitten" is the Path, "printable=yes&download=no" is the Query String, and "External_links" is the Anchor.The Port Number is typically omitted when default port numbers are used by the hostname server (80 for http, 443 for https). When Path and Query String are empty, the '/' character before the Path becomes optional, e.g, as in the url: 'https://en.wikipedia.org'.Write a function url2hostname that takes in a URL and returns the hostname (without the port…arrow_forward
- Edit the code to add a password and use json.stringify to store all the info correctly. Not as an object but to convert it to a string representation. Existing code: register.html <html><head><title>Registration Page</title><script src="./js/register.js"></script></head><body<br /><br /><form>Email:<input type="text" id="email" name="email"/> <br> <br> Phone:<input type="text" id="phone" name="phone"/> <br> <br> Address:<textarea id="address" name="address"> </textarea> <br> <br> City:<input type="text" id="city" name="city"/> <br> <br> State:<input type="text" id="state" name="state"/> <br> <br> ZIP Code:<input type="text" id="zip" name="zip"/> <br> <br> Contact Me:<input type="radio" id="contact" name="contact" value="text"/> Text <input type="radio" id="contact" name="contact"…arrow_forwardUse HTML/CSS/JavaScript to build a textbox that accepts a maximum of ten lower-case alphabetic characters. The entering of upper-case alphabetic characters, numeric characters, or special characters are prevented by your code. That is, the prohibited characters are unable to appear in the textbox. Events are to be addressed by JavaScript event listeners. Usage of HTML onEventName attributes are strictly prohibited. Note: you do not have to code a complete working webpage, only necessary code that satisfy the requirements are needed.arrow_forwardWhat would the output be? <!DOCTYPE html><html lang="en"> <head> <meta charset="utf-8"> <title>Syntax in JavaScript</title> </head> <body> <h1>JavaScript Example</h1> <p>JavaScript is a case-sensitive language,Case -sensitive means lower and upper case letters are different.</p> <script src="js/myscript.js"></script> <script> alert("Welcome to javascript world"); </script> </body></html>arrow_forward
- 76) Sample HTML for webpage is given <!DOCTYPE html> <html lang “on”> <head> <title> This is the title of the page </title> <style> #content { Border : solid 12px red; Color: blue; Position: absolute; Left: 10px; } </style> </head> <body> <div>Content about the first topic.</div> <div id=content>Content about the second topic.</div> <div>Content about the third topic. </div> </body> </html> There should not be a >bracket at the end. The language attribute name in the <html> tag should not be lang. There should not be a <body> tag There should be quote marks around the content ID in the second <div> tag.arrow_forwardUsing comments in the code, can you provide a line by line explination as to what the below HTML file is doing? The file relates to a WebGL program if that helps you. Please & thank you HTML File: <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" > <title>3D Sierpinski Gasket</title> <script id="vertex-shader" type="x-shader/x-vertex"> #version 300 es in vec3 aPosition; in vec3 aColor; out vec4 vColor; void main() { gl_Position = vec4(aPosition, 1.0); vColor = vec4(aColor, 1.0); } </script> <script id="fragment-shader" type="x-shader/x-fragment"> #version 300 es precision mediump float; in vec4 vColor; out vec4 fColor; void main() { fColor = vColor; } </script> <script type="text/javascript" src="../Common/initShaders.js"></script> <script type="text/javascript" src="../Common/MVnew.js"></script> <script type="text/javascript"…arrow_forwardImplement HTML code that displays the below lists. • One • Two 2. One 2. Two • Threearrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education

Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON

Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education