Colors used by the browser/OS for buttons, text selection etc. are known as 'system colors'. What you are looking for is the system colors "Highlight" and "HighlightText", and these are available in CSS2
element {
background-color: highlight;
color: highlighttext;
}
and javascript:
element.style.backgroundColor = 'Highlight';
element.style.color = 'HighlightText';
To reset them to default colors, set those properties back to empty string ''.
You can get a full list of system colors at http://www.w3.org/wiki/CSS/Properties/color/keywords. Note: that page says this is a feature of CSS2 and has been deprecated in favor of the CSS3 UI ‘[appearance]’ property, but if you read http://www.w3.org/TR/css3-ui/#appearance, it seems that system colors have been dropped from the UI appearance spec, so where that leaves us I have no idea.
Code provided above works in FireFox 32, Chrome 37, IE 11.