function StylePagePart(controlName) { try { let element = window.parent.document.querySelector('[controlname="' + controlName + '"]'); if (element) { let parent = element.parentNode.parentNode; if (parent) { parent.style.maxHeight = '150px'; } else { console.log('Could not find the parent parent of element "' + controlName + '".'); } let child = element.querySelector('div'); if (child) { child.style.paddingTop = '5px'; child.style.paddingBottom = '5px'; } else { console.log('Could not find the first child of element "' + controlName + '".'); } } else { console.log('Could not find element "' + controlName + '".'); } } catch (ignore) { console.log('Focus could not be invoked on control "' + controlName + '". ' + 'There is a null element in the window.parent.document selector.'); } }