My idea is when button1 is clicked to get input in textare and make search in Datatables.
I need help, hope for understanding.
my code is this, but I dont get result. I got other ways but i dont want to refresh page:
<script src="js/ie/jquery.placeholder.js"></script>
<script>
$(function() {
$('input, textarea').placeholder();
});
</script>
and to call it like this:
<p class="btn btn-primary" id="myInput" onclick="updateInput('button1')">button1</p>
Since you have provided almost zero information in your question except for the fact that you want to search the datatable on the click of a button, this should work for you.
var oTable = $("#myTable").DataTable();
$("button1").on('click', function(event){
var searchText = "button1"; //Specific text that you want to search
oTable.search(searchText).draw();
}
Here's a fiddle
If i am right in thinking you are trying to search for what ever value is in the text area then my below example would get you going..
Word of warning... people are not mind readers and more help from you (The one seeking help) can give us better ideas on what it is you are trying to achieve.
If you are using jQuery as you have tagged that in your OP.
Here jQuery will get the .val() of the input field once you click the button.
$("#YourButtonIdHere").click(function(){
// This will get the value of the search input text box
var inputText = $("#myInput").val();
// Now you can do what you wish, Perform an ajax query?
// More help from you on what you want to do with the value
// from the text box once the button has been clicked
// will give me a better chance of helping you!
});