Ans: Use document.forms.submit();
(0 refers to the index of the form – if you have more than one form in a page, then the first one has the index 0, second has index 1 and so on).
Ans: You can use several different methods of placing this script in you pages.
You can directly add a script element inside the body of page.
1. For example, to add the “last updated line” to your pages, In your page text, add the following:
<p>blah, blah, blah, blah, blah.</p>
<!– Hiding from old browsers
document.write(“Last Updated:” +
<p>yada, yada, yada.</p>
2. It can be placed inside the <head> element
Functions and global variables typically reside inside the <head> element.
<title>Default Test Page</title>
var myVar = “”;
3. It can be referenced from a separate file-
This scripting Language may also a placed in a separate file on the server and referenced from an HTML page. (Don’t use the shorthand ending “<script … />). These are typically placed in the <head> element.
Ques 7. How to detect the operating system on the client machine?
Ans: In order to detect the operating system on the client machine, the navigator.appVersion
string (property) should be used.
Ques 9. Explain Event Bubbling?
Ans: In Document Object Model(DOM), the behaviour of events in the child nodes and their parent nodes is defined and described by the EVENT BUBBLING. This means each and every child node is automatically passed onto their parent nodes. This increases the speed due to the single traverse of the DOM Tree. It help in reducing the complexity of the coding in the program.