How to set a HTML document’s background color?

Document.bgcolor property can be set to any appropriate color. To set the background color of an HTML document, you can use the CSS background-color property. Here’s how you would do it: htmlCopy code <!DOCTYPE html> <html> <head> <title>Background Color Example</title> <style> body { background-color: #ffcc00; /* You can use color names, hex values, RGB values, … Read more

What can javascript programs do?

Generation of HTML pages on-the-fly without accessing the Web server. The user can be given control over the browser like User input validation Simple computations can be performed on the client’s machine The user’s browser, OS, screen size, etc. can be detected Date and Time Handling. In a web development interview, when asked about what … Read more

Where are cookies actually stored on the hard disk?

This depends on the user’s browser and OS. In the case of Netscape with Windows OS,all the cookies are stored in a single file called cookies.txt c:\Program Files\Netscape\Users\username\cookies.txt In the case of IE,each cookie is stored in a separate file namely username@website.txt. c:\Windows\Cookies\username@Website.txt In web development interviews, when asked about where cookies are actually stored on … Read more

How to detect the operating system on the client machine?

In order to detect the operating system on the client machine, the navigator.appVersionstring (property) should be used. To detect the operating system on the client machine in web development, you can use JavaScript. Here’s a way to achieve this: javascriptCopy code var operatingSystem = “Unknown OS”; if (navigator.appVersion.indexOf(“Win”) != -1) operatingSystem = “Windows”; if (navigator.appVersion.indexOf(“Mac”) … Read more

How to read and write a file using javascript?

I/O operations like reading or writing a file is not possible with client-side javascript. However , this can be done by coding a Java applet that reads files for the script. In JavaScript, you can read and write files using various methods, depending on whether you’re working on the client-side (browser) or the server-side (Node.js). … Read more