js代码

$("#b-text").keypress(function(){
if(event.keyCode == 13){
var value=$("#b-text").val();
if(value.length > 0){
window.location="http://www.baidu.com/";
}else{
window.location="index.html";
}
}
});

html代码:

<input type="text" name="b-text" />

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-09-30
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-17
  • 2022-02-11
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-12
  • 2022-12-23
  • 2021-08-04
相关资源
相似解决方案