<!DOCTYPE HTML Public "-//W3C//DTD XHTML 1.0 transitional//en" "http://www.w3.org/TR/xhtml1/DTD/ Xhtml1-transitional.dtd "><HTMLxmlns= "http://www.w3.org/1999/xhtml"><Head><Metahttp-equiv= "Content-type"content= "text/html; charset=utf-8" /><title>Untitled Document</title></Head><style>. Red{Color:Red;}. Blue{Color:Blue;}#w a{Display:Block;}. Red img{Display:block!important;}#w a img{Display:None;}</style><Body><DivID= "W"> <aclass= "Red"title= "1">1<imgsrc=""width= "+"Height= " the"alt= "1"></a> <atitle= "2">2<imgsrc=""width= "+"Height= " the"alt= "2"></a> <atitle= "3">3<imgsrc=""width= "+"Height= " the"alt= "3"></a> <atitle= "4">4<imgsrc=""width= "+"Height= " the"alt= "4"></a></Div><Script>window.onload=function(){varOD=document.getElementById ("W");varOA=Od.getelementsbytagname ("a");varoimg=Od.getelementsbytagname ("img"); for(varI=0; I<Oa.length;i++) {Oa[i].onclick=function(){
Onclick--onmouseover for(varI=0; I<Oa.length;i++){if( This. Title==oa[i].title) { This. ClassName="Red"; Oimg[i].style.display="Block";}Else{oa[i].classname="Blue"; Oimg[i].style.display="None";}}};}};</Script></Body></HTML>
The idea is a bit messy, hope advice!
JS implementation element Add style