Currently, I have been utilizing event listeners to manipulate the :focus
pseudo-class of an input element:
const element = document.getElementById("myElementID");
element.addEventListener("focus", (e) => {
e.target.style.borderColor = "red";
});
element.addEventListener("blur", (e) => {
e.target.style.borderColor = "";
});
While this approach is functional, I am curious if there exists a more refined or conventional method to accomplish the same task using Vue
?