![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhdbrXCoCDLWNrBnp8rzxFwwr9ye2y2joOp08OhloS5C9_5ogcVpD9CMZvRkjfXObV21nKnTVfl1OM_HoXJH06bV5dtPWeLBFm3H6PXj50yOCCCtWij1eCm5ROfmu-tpmm4-dmkSy9YS5_e/w400-h225/Thumbnail.jpg)
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.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdQsjPmgyx-hljFN17Ib5NMUxhvqBA7WHCwdgZfZ429F67sYD83Y9VB2-1njrGP-IREWiSrRbEz-FZX-NVJGUolXUSifpYlMD08g5CKTeo-SSwf_W8Bo0MED8xIR369-eT5sHfWSkZMy-g/w640-h360/2.png)
After that you will get a console option at top. Click on it.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgyti7kLzb-8EWGUwEdE0-ERffK5CnpaQafvod_XUVNWEvS5pvbDY6KLE-EiqG1qomyOOljL1rP8gy7I6OA9qf4sQMdg5kJooc8YYZp67P7pqhs3e-crzDbeh-pGzF-OxxFzzMpGFiVg1wN/w640-h360/3.png)
There you will get your operating system name.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjwTOvfZEilwi2b7rkSOtd7FcBZk4ytQYP-pwK_JLa3v29AyPB6FtSL5wnPDu_dFCmb9HPia9qt9GWhb6bGIEnU2DDpVgZ108kd8xdhk5_uzR6Pa4FRCdZQJytQXID_sW65tfl30edRZJNs/w640-h314/1.png)
0 Comments: