- window.onload = function()
- {
- var seachs = document.getElementById('s');
- var seachb = document.getElementById('search1');
- seachs.onfocus = function()
- {
- if (!seachs.value || seachs.value=='输入姓名/题目/关键字等搜索') {
- seachs.value = '';
- }
- };
- seachs.onblur = function()
- {
- if (!seachs.value) {
- seachs.value = '输入姓名/题目/关键字等搜索';
- }
- };
- seachb.onfocus = function()
- {
- if (!seachb.value || seachb.value=='百度搜索') {
- seachb.value = '';
- }
- };
- seachb.onblur = function()
- {
- if (!seachb.value) {
- seachb.value = '百度搜索';
- }
- };
- }
- //该片段来自于http://www.codesnippet.cn/detail/2110201410741.html
来源: http://www.codesnippet.cn/detail/2110201410741.html