I am trying to create a lock using HTML and JavaScript. I want to know how can I change the input and output of another function. Lets say I have a function
function a() {document.getElementById("x").id="b"}.
I want to change the element x and the id that's going to be changed "b" by using another function.
I have tried putting the function inside another function but hasn't worked
function a() {document.getElementById("x").id="b";}
function c() {document.getElementById("a()").document.getElementById="b";}