Slip 28
Q Write a JavaScript program to construct the
following pattern up to n lines, using a nested for loop.
*
* *
<script
type="text/javascript">
var i, j;
for(i=1; i <= 3; i++)
{
for(j=1; j<=i; j++)
{
document.write('*');
}
document.write('<br/>');
}
</script>
</html>
Q2. Design a HTML form for Bus Ticket
Reservation consisting of fields for Name, Address, contact no, source
station(Dropdown list), Destination station, Date of booking, date of journey,
no of passenger, name of passenger, gender of passenger etc. You should provide
button to submit as well as reset the form contents. (Use proper alignment)
<body>
<Table height="70%"
width="80%">
<font
face="arial" size="5" align="center"> Bus
Ticket Reservation From </font>
<td>Name:
</td>
<td><input
type="text" name="First Name"></td>
</tr>
<td>Address:
</td>
<td><input
type="text" name="First Name"></td>
</tr>
<td>Contact
no. </td>
<td><input
type="text" name="contact no."></td></tr>
<td>
<select>
<option
value="Mumbai">Mumbai</option>
<option
value="New Delhi">New Delhi</option>
<option
value="Bangalore">Bangalore</option>
<option
value="London">London</option>
</select></td>
</tr>
<tr><td>Destination Station: </td>
<td><input
type="text" name="First Name"></td></tr>
</tr>
<td><input
type="date-local"></td></tr>
<td><input
type="date-local"></td></tr>
<td><input
type="text" name="contact no."></td></tr>
<td><input
type="text" name="First Name"></td>
</tr>
<td><input
type="radio" name="gender" value="male"
checked> Male
<input
type="radio" name="gender" value="male">
Female</td>
</tr>
<input
type="submit" value="submit" style="
target:submit;">
</form>
</body>
</html>