Skip to content

Instantly share code, notes, and snippets.

@devzer01
Created Mar 14, 2020
Embed
What would you like to do?
fix one problem and create many for no good reason code
var content = document.createElement('div')
content.id = 'alert';
content.style.width = '100%';
content.innerHTML = 'tax translation helper is loaded';
content.style.height = '100px';
content.style.textAlign = 'center';
content.style.display = 'none';
var body = document.getElementsByTagName('body')[0];
body.appendChild(content);
var s = document.createElement('script');
s.innerHTML = "alert = function(text){ var c = document.getElementById('alert'); c.innerText = text; c.style.display = 'block'; }";
body.appendChild(s);
setExitText('bExit', 'Exit')
setExitText('bChangeName', 'Change Name (above)')
setExitText('bChangeAdd', 'Change Address (above)')
setExitText('bNext', 'Next')
setExitText('bClear', 'Clear')
setEmpTaxIdLabel()
function setExitText (elm, text) {
var btnExit = document.getElementById(elm)
if (btnExit == null) return false;
var anchorExit = btnExit.parentElement
var tdElm = anchorExit.parentElement
var title = document.createElement('h2')
title.innerText = text
title.className = 'i18n'
tdElm.appendChild(title)
}
function setEmpTaxIdLabel () {
if (document.getElementById('f401_nidtin') != null && document.getElementById('401_13') != null) {
var emplouyerTaxId = document.getElementById('f401_nidtin');
var employerTaxIdText = document.createElement("h4")
employerTaxIdText.innerText = "Employer Tax ID Number"
employerTaxIdText.className = 'i18n'
emplouyerTaxId.parentElement.appendChild(employerTaxIdText);
} else {
window.setTimeout(() => {
setEmpTaxIdLabel();
}, 1000)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment