1、当然是先引入jq;
2、编写css
3、页面代码:
<form name="searchform" id="searchform" method="post" action="/search/index.php" target="_blank">
<table width="427" border="0" align="center" cellpadding="3" cellspacing="1">
<input type="hidden" name="classid" value="18">
<input type="hidden" name="andor" value="and">
</form>
4、JS代码
$(document).ready(function(){
});
5、最终表现
PS:上列是当页面有多个form表单的情况,JS判断的是from的ID(如果不用from的ID来判断,用下面的第二种方法会产生冲突,因为第二种方法就是判断form)。
另一种情况是整个页面就一个form的,JS
$(document).ready(function(){
});
注意红色部分和第一种方法的区别!
新闻热点
疑难解答