The following is an example. After measurement, you can optimize it as needed:
& lt! DOCTYPE html & gt
& lthtml & gt
& lthead & gt
< title & gt menu
& ltscript type = " text/JavaScript " & gt;
Function chgimg(src)
{
var img = document . getelementbyid(" img ");
img.src=src+"。 jpg ";
}
& lt/script & gt;
& lt/head & gt;
& ltbody & gt
& ltdiv & gt
& ltp & gt& ltimg src = " a 1 . jpg " id = " img "/& gt; & lt/p & gt;
& ltp & gt& ltul & gt& ltLi onclick = " chg img(' a2 ');" & gta</ Li> & ltlionclick = "chgimg ('a3');" & gtb</ Li>& lt Li onclick = "chgimg ('a1');" & gtc</ Li>& lt/ul & gt;; & lt/p & gt;
& lt/div & gt;
& lt/body & gt;
& lt/html & gt;