Code for the IR sensor

we write an HTML code for uploading various files to bolt on the webpage.
However i only copy pasted the html code and uploaded it to bolt.
i want to know the actual code for the ir sensor to work. As in the algorithm that is there behind the working of ir sensor. Also, in which language is that code wrtten?

@devanshibhatt19 The algorithm behind working of IR Sensor is basically written using Javascript/CSS.

So could I write a code of my own for the sensor in js and add its link to the main html code?
will the html code work in that case?

Yes the code shall work if your logic is correct.