<!--Do not make any change in this code template; add codes in the areas indicated--> <!DOCTYPE html> <html> <head> <title>Elektra Waves Concert Ticket Booking</title> <style> body{ background-image:url("concert.jpg"); opacity: 0.9; font-weight: bold; } h3, #result, caption{ color: #FFFFFF; font-family: Verdana; text-align: center; } .title{ color: #000000; } #tickettable{ margin-left: auto; margin-right: auto; width: 50%; } #costchart{ margin-left: auto; margin-right: 0; } td, th{ background-color: #ffffff; color: #000000; padding:7px; border:2px solid #000000; } input[type="tel"],select,textarea,input[type="text"]{ width:97%; } input[type="range"]{ width:94%; } input::placeholder { color:black; } #submit,#clear{ color: #000000; padding:7px; border-radius: 5px; font-weight: bold; } #buttons{ margin-left: 40%; } </style> <script src="script.js"> </script> </head> <body> <form onsubmit="return costCalculation();"> <h3>Elektra Waves Concert Ticket Booking</h3><br/> <table id="tickettable" > <tr><td colspan="2"><a href="#costchart" id="costchart_ref">View ticket cost chart</a></td></tr> <tr><td colspan="2" class="title">Personal Details</td></tr> <tr> <td><lable>Name</lable></td> <td> <input type="text" id="name" placeholder="Enter your name" pattern="^[a-zA-Z\s]*$" required> </td> </tr> <tr> <td>Gender</td> <td> <input type="radio" name="gender" id="male" value="male" required > <label for="male">Male</label> <input type="radio" name="gender" id="female" value="female" required > <label for="female">Female</label> </td> </tr> <tr> <td>Address</td> <td><textarea name="address" id="address" rows="4" cols="50" placeholder="Enter your address" required></textarea></td> </tr> <tr> <td>Phone Number</td> <td><input type="tel" name="phoneNumber" id="phoneNumber" placeholder="Enter your phone number" pattern="[7-9]{1}[0-9]{9}" required></td> </tr> <tr><td colspan="2" class="title">Ticket Details</td></tr> <tr> <td>No Of Tickets</td> <td> <input type="range" name="noOfTickets" id="noOfTickets" min="5" max="40" step="1" value="" required ><span id="demo"></span></td> </tr> <tr> <td>Ticket Type</td> <td> <select id="ticketType"> <option id="Floor" value="Floor"> Floor </option> <option id="Balcony" value="Balcony">Balcony</option> </select> </td> </tr> <tr> <td>Add Ons</td> <td> <input type="checkbox" name="addOns" id="couponCode" value="CouponCode" ><label>CouponCode</label> <input type="checkbox" name="addOns" id="refreshment" value="Refreshment" ><label>Refreshment</label> </td> </tr> <tr> <td>Coupon Code</td> <td> <input type="text" id="cc" list="couponCodes" required value=""> <datalist id="couponCodes"> <option value="ELEKTRA20"></option> <option value="SIMBA20"></option> </datalist> </td> </tr> </table> <br/><br/> <div id="buttons"> <input type="submit" id="submit" value="CONFIRM BOOKING" > <input type="reset" id="clear" value="CLEAR" > </div> <br/> <div id="result" name="result"></div> <br/><br/> <table id="costchart"> <caption>Ticket Cost Chart</caption> <tr> <th>Ticket Type</th> <th>Base Price</th> <th>On Booking more than 20 tickets</th> <th>On applying coupon code</th> </tr> <tr> <td>Floor</td> <td>400</td> <td>10% discount</td> <td>2% discount</td> </tr> <tr> <td>Balcony</td> <td>500</td> <td>10% discount</td> <td>2% discount</td> </tr> <tfoot> <tr> <td colspan=4>* You must pay Rs.100 extra on choosing Refreshment!</td> </tr> </tfoot> </table> </form> </body> </html>
Write, Run & Share HTML code online using OneCompiler's HTML online Code editor for free. It's one of the robust, feature-rich online Code editor for HTML language, running on the latest version HTML5. Getting started with the OneCompiler's HTML compiler is simple and pretty fast. The editor shows sample boilerplate code when you choose language as HTML
. You can also specify the stylesheet information in styles.css
tab and scripts information in scripts.js
tab and start coding.
HTML(Hyper Text Markup language) is the standard markup language for Web pages, was created by Berners-Lee in the year 1991. Almost every web page over internet might be using HTML.
<!DOCTYPE html>
<html>
and ends with </html>
<h1>
to <h6>
where <h1>
is the highest important heading and <h6>
is the least important sub-heading.<p>..</p>
tag.<a>
tag.
<a href="https://onecompiler.com/html">HTML online compiler</a>
<img>
tag, where src
attribute consists of image name.<button>..</button>
tag<ul>
for unordered/bullet list and <ol>
for ordered/number list, and the list items are defined in <li>
.<a href="https://onecompiler.com/html">HTML online compiler</a>
CSS(cascading style sheets) describes how HTML elements will look on the web page like color, font-style, font-size, background color etc.
Below is a sample style sheet which displays heading in green and in Candara font with padding space of 25px.
body{
padding: 25px;
}
.title {
color: #228B22;
font-family: Candara;
}
<table>
tag.<tr>
tag<th>
tag<td>
tag<caption>
tag<script>
is the tag used to write scripts in HTML<script src="script.js"></script>