I want to replace English text by Arabic text which is coming before and after a dropdown field
I want to replace English text by Arabic text which is coming before and after a dropdown field
![maazasif63](https://secure.gravatar.com/avatar/c91989b4b16988841639f2e1b088c38a/?default=https%3A%2F%2Fvanillicon.com%2Fc91989b4b16988841639f2e1b088c38a_200.png&rating=g&size=120)
My code replaces the text but the functionality of the dropdown stops working once this js is executed otherwise before it the dropdown works fine.
var input = $("#DataTables_Table_0_length > label > input").detach();
$("#DataTables_Table_0_length > label")
.html(
'يبحث <select name="DataTables_Table_0_length" aria-controls="DataTables_Table_0" class="custom-select custom-select-sm form-control form-control-sm"><option value="10">10</option><option value="25">25</option><option value="50">50</option><option value="100">100</option></select> abc ',
)
.append(input);
Edited by Allan - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.
This question has an accepted answers - jump to answer
Answers
Yes, because you've replaced the DOM elements that DataTables put into the document which removes their event listeners.
Instead of doing that, use
language.lengthMenu
to customise the text shown.Allan
@allan can you please provide an example . I only need to replace the text coming before and after the dropdown and nothing is to be changed in the dropdown menu
https://live.datatables.net/yitakevo/1/edit .
Allan