a. var m = parseFloat(document.frm1.txtA.value); var f = m * 5280; document.frm1.txtB.value = f; If 20 is the value of txtA, what will be the value in txtB after the JavaScript code executes. Ans: 10560 b. What is displayed in the alert box? var x = 5; x = x + 1; var a = cat + x + dog window.alert(a); Ans: cat6dog c. var s; var n = parseFloat(document.frm1.txtA.value); n = n + 2; if (n > 6) { s = big; } else { s = small; } window.alert(s); What is shown in the alert box if 5 is entered in the textbox? Ans: big
var n = 1; while (n <= 20) { window.alert(n); n = n + 3; } Ans: 1 4 7 10 13 16 19
Ans: var n = 1000; while (n >= 0) { window.alert( ); n = n - 7; }
<p id=a style=background-color:pink;>Use this JavaScript statement to change the background color of the document:
document.getElementById(a).style.backgroundColor = beige;or
document.getElementById(a).style.backgroundColor = rgb(255,255,230);or
document.getElementById(a).style.backgroundColor = #FFE0FF;