首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > JavaScript >

JQUERY $("form:first").submit();在IE6下面不执行,咱整,该怎么处理

2012-02-04 
JQUERY $(form:first).submit()在IE6下面不执行,咱整JQUERY $(form:first).submit()在IE6下面不执行

JQUERY $("form:first").submit();在IE6下面不执行,咱整
JQUERY $("form:first").submit();在IE6下面不执行,咱整

[解决办法]

HTML code
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><title>无标题文档</title><style>  p { margin:0; color:blue; }  div,p { margin-left:10px; }  span { color:red; }</style><script src="http://code.jquery.com/jquery-latest.js"></script></head><body><p>Type 'correct' to validate.</p><form action="javascript:alert('success!');">    <div>      <input type="text" />      <input type="submit" />    </div></form>  <span></span><script>    $("form:first").submit(function() {      if ($("input:first").val() == "correct") {        $("span").text("Validated...").show();        return true;      }      $("span").text("Not valid!").show().fadeOut(3000);      return false;    });</script></body></html> 

热点排行