dimanche 30 mai 2021

Printing the values written in the console log to the screen

I wish you a healthy day. I had one question. As you can see in the photo below, console.log contains the coordinates of the mouse on the photo. How can I write these coordinates as X, Y under the photo so that they will change instantly in the same way and appear on the page, not the console? At the same time, when clicked with the mouse, I want it to write the coordinates under it as a list, like a record. Thanks.

I am using these codes to write the coordinates on console.log :

    let pos = getCursor()
    console.log('pos:', pos)

The Screenshot of the screen and console : Screenshot




Aucun commentaire:

Enregistrer un commentaire