(i.e. after a button is pressed)
The tantalising answer is yes but without more detail of how you are setup and actually trying to do, we can only guess at an answer that would suit.
Also when you use key words like canvas you may not get the answer you expect because you are using a term with no context but which has many meanings within different contexts.
Can you provide more concise detail and possibly an example project.
I wanted to dynamically control where an element is placed within the scene using JS.
It kind of works with this:
document.getElementById(“object1”).style.left = 100 + “px”;