求助,网页的二个状态之间如何写判断语句
一网页,点击一按钮 后会与前一状态之间的源码的不同仅部分不同:
未点击前: <td rowspan="2" style="width: 714px; height: 65px;"><span id="xwqd">下午请签到!</span></td>
<input type="image" name="ImageButton2" id="ImageButton2" src="Images/xwqd.jpg" style="border-width:0px;" /> </td>
点击后:<td rowspan="2" style="width: 714px; height: 65px;"><span id="xwqd" style="color:Red;">你已签过!</span></td> </td>
好象就几个汉字之间的差距,请问一下,怎么写这二个状态不同的判断语句??
[解决办法]
<!doctype html public "-//w3c//dtd html 4.0 transitional//en"><html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gbk" /> <title> new document </title> <meta name="generator" content="notepad"> <meta name="author" content=""> <meta name="keywords" content=""> <meta name="description" content=""> </head><SCRIPT LANGUAGE="JavaScript"><!-- function buttonClick() { //此处如要进行复杂些的比较或匹配,请参考js中正则表达式的用法 if(document.getElementById("xwqd").innerHTML == "下午请签到! "){ document.getElementById("xwqd").innerHTML = "你已签过!"; } }//--></SCRIPT> <body> <TABLE> <TR> <td rowspan="2" style="width: 714px; height: 65px;"> <span id="xwqd">下午请签到! </span> </td> <input type="image" name="ImageButton2" id="ImageButton2" src="Images/xwqd.jpg" onclick="javascript:buttonClick();" style="border-width:0px;" /> </td> <TD></TD> </TR> </TABLE> </body></html>
[解决办法]
if Form1.WebBrowser1.Document.getElementsByTagName("span")("xwqd").innertext="你已签过! " then Form1.WebBrowser1.Document.getElementsByTagName("input")("ImageButton2").click