how to remove "find an item" water mark in the List View ootb search box?
2 Answers
Using CSS:
<style type="text/css">
.ms-InlineSearch-SearchBox-EmptyUnfocused {
display:none;
}
.ms-inlineSearch-searchImgSpanStandard {
float:right;
}
</style>
Using JavaScript:
<script type="text/javascript">
window.onload = function () {
//Create a function to be able to hide the text if the field loses focus and would need to be hidden again
function clearSearchbox() {
//Create a reference to the input search field
listSearch = document.querySelector('input[id^="inplaceSearchDiv"].ms-InlineSearch-SearchBox-EmptyUnfocused');
listSearch.value = '';
};
//Clear the search input when the page has loaded
clearSearchbox();
//Attach en event that to hide the text if the search input loses focus / clicked elsewhere on the page
listSearch.addEventListener("focusout", clearSearchbox);
};
</script>
I think you need to do some custom JavaScript. You can add this JavaScript using Content Editor or using JSLINK.
$("#inplaceSearchDiv_WPQ1_lsinput").value= " "
Above code will make List View OOTB search Box Empty.