If you are talking about how it is implemented by the browser, it is usually written in an object-oriented language because of its modular nature.
In Firefox, which uses C ++, there is an open source policy, you can view the code for the html parser here .
source share