Javascript Code:
Create a new javascript file and name it OSDetector.js. Then write the following codes:
HTML Code:
Create a new html file and name it index.html. Then write the following codes:
Then in visual studio code, install "Live Server" extension.
Then come to index.html and right click on the screen and select "Open with live server" option.
Then a new blank tab will be opened. There, right click on the screen and click on "Inspect" option.
After that you will get a console option at top. Click on it.
There you will get your operating system name.
0 Comments: