Page 299 - Web Applications (803) Class 12
P. 299

if (mobile) {
                                 greetingMessage += ` Your mobile number is ${mobile}.`;

                             }
                             greeting.textContent = greetingMessage;
                         } else {

                             greeting.textContent = “Please enter your name.”;
                         }
                     });       // ` is the key below Esc key. It is not single quote.
                 PROJECT 3


                 A simple Profile Page using HTML, CSS and JavaScript. The JavaScript code allows to edit the information displayed on
                 the webpage.
























                 File1: Index.html
                     <html>

                     <head>
                         <title>My Personal Profile</title>
                         <link rel=”stylesheet” href=”styles.css”>

                     </head>
                     <body>
                         <header>
                             <h1>My Personal Profile</h1>

                         </header>
                         <section class=”profile”>
                             <img id=”profile-image” src=”Image1.jpg” alt=”Profile Picture”>

                             <h2>Name: <span id=”name”>Anita</span></h2>
                             <p>Age: <span id=”age”>24</span></p>
                             <p>Location: <span id=”location”>Amritsar, Punjab</span></p>
                             <button id=”edit-button”>Edit Profile</button>

                         </section>
                                                                                                          Projects   297
   294   295   296   297   298   299   300   301   302   303   304