<input type="text" value="google搜索" name="google" /><input type="button" value="Google"  name="google"/><br />
<script type="text/
javascript"> 
//搜索指定的网页内容
$("input[type='button']").click(function(){  
        var value=$("input:text[name="+this.name+"]").val();  
        var link="";  
        //w3school  
        var w3=" site:www.jb200.com";  
        if(this.name=="baidu"){link="http://www.baidu.com/s?wd="}     
        else if(this.name=="google"){link="http://www.google.com.hk/search?hl=zh-CN&source=hp&q="}  
        open(link+value+w3);  
});  
</script>