input:hover, input.hover { background-color: red; }
function addHoverToInput() { var inputs = document.getElementsByTagName('input'); for(var i=0; i<inputs.length; i++) { if(inputs[i].type == 'submit') { inputs[i].onmouseover = function() { this.className = hover } inputs[i].onmouseout = function() { this.className = ''; } } } } window.onload=addHoverToInput;
CSS
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="hu" xml:lang="hu">
<head>
<title> Hover proba </title>
<style type="text/css">
input:hover {
background-color: red;
}
</style>
</head>
<body>
<form>
<input type="submit" name="submit" value="submit" />
</form>
</body>
</html>
ie6-al ez nem kompatibilis
css-be:
Köszönöm