English
Very simple JS code to highlight the current line after clicking
Try running:
Run the demo <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> Simple code to highlight the current line<script> var theObj; function hilight(obj){ if(theObj!=null ){theObj.style.background = "#fff";} if(theObj = obj){obj.style.background = "red";} } </script> <ul> <li onclick="hilight(this)" >Click to highlight the current line</li> <li onclick="hilight(this)">Click to highlight the current line 1</li> <li onclick="hilight(this)">Click to highlight the current line 2</li> li> <li onclick="hilight(this)">Click to highlight the current line 3</li> <li onclick="hilight(this)">Click to highlight the current line 4</li> </ul> <p >Start a new list below</p> <ul> <li onclick="hilight(this)">Click to highlight the current line</li> <li onclick="hilight(this)">Click to highlight the current line 1 </li> <li onclick="hilight(this)">Click to highlight the current row 2</li> <li onclick="hilight(this)">Click to highlight the current row 3</li> <li onclick= "hilight(this)">Click to highlight the current line 4</li> </ul>