Write a javascript function to compute the sum of factors of a input number
<body>
<script>
function sum() {
var sum = 0, i, str,num1;
num1 = number(document.getelementbyid("n").value);
sum = 0;
for (i = 0; i < str.length; i++) {
sum += parseint(str.charat(i), 10);
}
window.alert(sum);
}
</script>
</head>
<body>
enter a number : <input type="text"
id="n"><br/>
<button onclick="sum()"> sum is </button>
<body>
</html>
Write a html code to
display calendar of current month in tabular format. use proper color for week
days and holidays. display month name, year and images as advertisement at the
beginning of the calendar.
<html>
<body>
<th><font color="red">sun</font></th>
<th>mon</th>
<th>tus</th>
<th>wed</th>
<th>thu</th>
<th>fri</th>
<th>sat</th>
</tr>
<th> </th>
<th> </th>
<th> </th>
<th>1</th>
<th>2</th>
<th>3</th>
<th>4</th>
</tr>
<th><font
color="red"><b>5</font></th>
<th>6</th>
<th>7</th>
<th>8</th>
<th>9</th>
<th>10</th>
<th>11</th>
</tr>
<th><font
color="red"><b>12</font></th>
<th>13</th>
<th>14</th>
<th>15</th>
<th>16</th>
<th>17</th>
<th>18</th>
</tr>
<th><font
color="red"><b>19</font></th>
<th>20</th>
<th>21</th>
<th>22</th>
<th>23</th>
<th>24</th>
<th>25</th>
</tr>
<tr>
<th><font
color="red"><b>26</font></th>
<th>27</th>
<th>28</th>
<th>29</th>
<th>30</th>
<th>31</th>
<th> </th>
</tr>
</body>
</html>