Platinum Partner

Highlight INPUT Fields OnFocus

// Highlight INPUT fields onFocus


//JavaScript that looks for all elements with the tag name "input" and gives it a class called "textfield_on" when the specific input is in focus
function highlight() {
	var elements = document.getElementsByTagName("input");
    for (i=0; i < elements.length; i++) {
        if (elements[i].type != "button" && elements[i].type != "submit" && elements[i].type != "reset") {
            elements[i].onfocus=function() {this.className='textfield_on';};
            elements[i].onblur=function() {this.className='textfield'};
        }
    }
}

window.onload = highlight;

//example of an input element


{{ tag }}, {{tag}},

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}
{{ parent.authors[0].realName || parent.author}}

{{ parent.authors[0].tagline || parent.tagline }}

{{ parent.views }} ViewsClicks
Tweet

{{parent.nComments}}