Академический Документы
Профессиональный Документы
Культура Документы
1. With the help of suitable example, explain two points of difference between global
3. Rewrite the above code using while loop without affecting the output.
var con = 0 ;
i = 3;
do
con = con + 1;
i-- ;
} while (i>=0)
</script>
4. Create a form that contains a Tax Calculator as shown below. When the user enters his
salary, the tax to be paid should be displayed in the second textbox.
The calculation of tac should be done as follows:
If the salary is greater than or equal to 200000, then the tax should be 10% of the
salary.
If the salary is greater than or equal to 100000 but less than 200000, then the tax
should be 5% of the salary.
And if the salary is less than 100000, then no tax.
Write the HTML code for creating the form and the embedded JavaScript code for the
click event of the button.
5. Give the output of the following set of statements:
<SCRIPT LANGUAGE="JavaScript">
var car[3];
count = 0;
for(i = 2; i>=0;i--)
{
car[i] = i + count;
document. write (car[i]);
count = count + 1;
}
</SCRIPT>
6. Rewrite the above code using do-while-loop without effecting the output
7. Create a form that contains a list of mail services as shown below
Select a location from the list
Write the HTML code for creating the form and the embedded JavaScript code to open
the corresponding website in a new window on the selection of any list item.
Go to Yahoo!! Link to http://www.yahoo.com
Go to Hotmail!! Link to http://www.hotmail.com
Go to Rediff!! Link to http://www.rediff.com
9. A code to display the no. of characters of a string is written below. Fill in the blank to
complete it:
<script language=”javascript”>
var sometext = “Bye!”
document.write(_____________(sometext))
</script>
<SCRIPT LANGUAGE="JavaScript">
var sum, a;
sum = 0;
a = 1;
do
{
sum = sum + a;
a = a+2;
}while(a<=8)
document.write(sum);
</SCRIPT>