<div class="codetitle"> <span><a style="CURSOR: pointer" data="94141" class="copybut" id="copybut94141" onclick="doCopy('code94141')"><u>Copy code</u></a></span> The code is as follows:</div> <div class="codebody" id="code94141"> <br><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <br><html xmlns="http://www.w3.org/ 1999/xhtml"> <br><head> <br><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <br><title>None Title Document</title> <br><script src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-1.9.0.min.js"></script> <br> <script type="text/javascript"> <br>$(function() { <br>// JQuery code<br><br>var oldhh; <br>var oldmin; <br>var oldss; <br><br>$(document).ready(function() { <br>fillDate(); <br>}); <br>function fillDate(){ <br>var date = new Date(); <br>var yy = date.getFullYear(); <br>var mm = date.getMonth() 1; //Intercept the month, <br>var dd = date.getDate(); //Intercept the day, <br>var cal = yy "." mm "." dd; <br>var hh = date.getHours(); //Intercept hours, <br>var min = date.getMinutes(); //Intercept minutes, <br><br>var ss = date.getTime() % 60000; <br>ss = (ss - (ss % 1000)) / 1000; //Then, process the obtained milliseconds into seconds <br>//(hh " :" min ":" ss); <br>oldhh = hh; <br>oldmin = min; <br>oldss = ss; <br>//alert(oldmin ":" oldss); <br>} <br>window.setInterval(test,1000); <br>function test(){ <br>var date = new Date(); <br>var hh = date.getHours(); //Truncate the hour, which is 8 <br>var min = date.getMinutes(); //Truncate minutes, that is, 34 <br>var ss = date.getTime() % 60000; <br>ss = (ss - (ss % 1000)) / 1000; // Then, process the obtained milliseconds into seconds <br>var betweenhh; <br>var betweenmin; <br>var betweenss; <br><br>if(ss<oldss){ <BR>betweenss = ss 60- oldss; <BR>betweenhh = hh-oldhh; <BR>betweenmin = (min betweenhh*60)-1 - oldmin; <br><br><BR>//alert("Distance from last refresh" betweenmin "minutes" betweenss "seconds"); <BR>}else{ <BR>betweenss = ss-oldss; <BR>betweenhh = hh-oldhh; <BR>betweenmin = (min betweenhh*60) - oldmin; <BR>//$ ("#message").html("Distance from last refresh" betweenmin "minutes" betweenss "seconds"); <BR>//alert("Distance from last refresh" betweenmin "minutes" betweenss "seconds"); <BR>} <BR>if(betweenmin<10){ <BR>if(betweenss<10){ <BR>$("#message").html("0 from last refresh" betweenmin "minutes 0" betweenss "seconds "); <BR>}else{ <BR>$("#message").html("0 since last refresh" betweenmin "minutes" betweenss "seconds"); <BR>} <br><br>} else{ <BR>if(betweenss<10){ <BR>$("#message").html("Distance from last refresh" betweenmin "minutes 0" betweenss "seconds"); <BR>}else{ <BR>$("#message").html("Since last refresh" betweenmin "minutes" betweenss "seconds"); <BR>} <BR>} <BR>} <BR>}); <BR>function ByStateflag () <BR>{ <BR>alert("hah"); <BR>var value = document.getElementById("stateflag").value; <BR>alert(value); <BR>} <BR>< /script> <br></head> <br><body> <br><div id="message"> <br><br></div> <br><select id= "stateflag" name="stateflag" onchange="ByStateflag()"> <br><option selected value="">Transaction Status</option> <br><option value="0"> In progress</option> <br><option value="1">Terminated transaction</option> <br><option value="3">Buyer has locked the goods</option> <br><option value="4">Buyer handles payment</option> <br><option value="5">Transaction completed</option> <br></select> <br><br></body> <br></html> <br> </div>