point-and-click character movement

how can i make (in javascript) so when i click anywhere in the screen, my character tries to move to the nearest point available, pathfinding its way, and still being able to receive collision interferences?

Like this:
Pathfinding Image

how can i make (in javascript) so when
i click anywhere in the screen, my
character tries to move to the nearest
point available, pathfinding its way,
and still being able to receive
collision interferences?

That’s called pathfinding. There are many ways of going about it and many examples floating around. Do a Google search and read up on old answers and solutions.