<input class="jrzj_twoindex_textinput" id="searchWordHot" name="" onblur="hotBlur();" onfocus="hotFocus();" size="60" type="text" value="" /> <script language="JavaScript" type="text/javascript">
//search函数点击搜索按钮时需要执行的函数,获取用户输入的内容,跳转到搜索结果页面,
//encodeURIComponent函数将中文进行转换,兼容多浏览器
function search(){
var content = document.getElementById("searchWordHot").value;
window.open('http://search.jrzj.com/AdvisorySearchResultAction?pageNum=1¶meter='+encodeURIComponent(content)+'&count=power&genre=advisory');
}
//以下为按下enter键时候的事件
$(document).ready(function(){
$("#searchWordHot").keydown(function(e){
var curKey = e.which;
if(curKey == 13){
$("#search").click();
return false;
}
});
});
//使用attr()函数将class的值替换为jrzj_twoindex_textinput header_a_color class属性可以有多个值,中间以空格隔开就行
$("#searchWordHot").attr("class","jrzj_twoindex_textinput header_a_color");
</script><input id="search" class="jrzj_twoindex_button" type="button" value="搜索" /></div>