JavaScript 使用JQuery更改SharePoint 2010中的默认搜索框文本

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了JavaScript 使用JQuery更改SharePoint 2010中的默认搜索框文本相关的知识,希望对你有一定的参考价值。

$(function() {
 
var theSearchBox = $('#searchBoxOuter td.ms-sbcell input');
var defaultSearchText = "Search this site";
var preferredSearchText = "Search my custom site name";
  
theSearchBox.val(preferredSearchText);   //replace the text initially

theSearchBox.blur(function() { //replace the text when the search box loses focus and no value entered
  if ($(this).val().indexOf(defaultSearchText) > -1)
    $(this).val(preferredSearchText);  
  
});

  
});

以上是关于JavaScript 使用JQuery更改SharePoint 2010中的默认搜索框文本的主要内容,如果未能解决你的问题,请参考以下文章