Mouse moved into the onmouseover and mouse out of the onmouseout, the code is not uppercase I do not write that much. First, we have to get all the things in the class Tr_item, which is the data in the item tag. Then, we define a oldcolor to be empty and one to record the original color. We then use a for loop to enclose all of the two events in the item label. <%--Light Bar effect--%> <script type="Text/javascript">window.onload=function () {varItems = Document.getelementsbyclassname ("T-body"); varOldcolor =""; for(vari =0; i < items.length; i++) {Items[i].onmouseover=function () {Oldcolor= This. Style.backgroundcolor; This. Style.backgroundcolor ="Green"; }; Items[i].onmouseout=function () { This. Style.backgroundcolor =Oldcolor; }; } };</script>
When the user clicks the Delete button, a confirmation box pops up, and if the user clicks OK to perform the delete operation, it does not execute
Method One:
<a href="javascript:if (' Do you really want to delete it? ') Location= ' delete.aspx?un=<% #Eval ("goodsname")%> '"> Delete </a >
Method Two:
JS Code:
function del () {var" are you sure you want to delete it?" \ n Please confirm! "; if (Confirm (msg) = =true) {returntrue;} Else {returnfalse;}}
HTML code:
<a href="" onclick="Javascript:return del (); the> Delete </a>
Method Three:
<! DOCTYPE HTML Public"-//W3C//DTD XHTML 1.0 transitional//en" "HTTP://WWW.W3.ORG/TR/XHTML1/DTD/XHTML1-TRANSITIONAL.DTD"> "http://www.w3.org/1999/xhtml"> "Content-type"Content="text/html; Charset=utf-8"/> <title> confirm whether to delete </title> <script type="Text/javascript">function del () {if(!confirm ("Are you sure you want to delete? ") {window.Event. returnvalue =false; } } </script> "http://www.baidu.com"onclick="return del ()"> Delete </a> </body> Method Four:
<script type="Text/javascript"Language="JavaScript"> <!--function Confirmact () {if(Confirm ('Are you sure you want to perform this operation ?')) { return true; } return false; } // -</script> <a href="operate.aspx?mod=user&act=delete&id=564"onclick="return Confirmact ();"> Perform Operations </a>
WebForm Light Bar effect, delete action popup ok cancel window