1focusMethod = function getFocus() {
2 document.getElementById("myButton").focus();
3}
1const form = document.getElementById('form');
2
3form.addEventListener('focus', (event) => {
4 event.target.style.background = 'pink';
5}, true);
6
7form.addEventListener('blur', (event) => {
8 event.target.style.background = '';
9}, true);
1focusMethod = function getFocus() {
2 document.getElementById("myTextField").focus();
3}