Created
April 19, 2018 22:42
-
-
Save rafaehlers/ca73a92f7f3e91bf8a506faecf108db6 to your computer and use it in GitHub Desktop.
Turns the search label into a placeholder for DataTable's Search field
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php wp_footer(); ?><!-- DON'T COPY THIS LINE, IT'S JUST HERE SO YOU KNOW WHERE TO PLACE THE <SCRIPT> BELOW --> | |
<script type="text/javascript"> | |
(function($){ | |
$(document).ready(function(){ | |
$("#DataTables_Table_0_filter :input").attr("placeholder", 'Search'); | |
var divhtml = $("#DataTables_Table_0_filter label").html(); | |
$("#DataTables_Table_0_filter label").html(divhtml.replace("Search:", " ")); | |
}); | |
})(window.jQuery); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment