Why does the search break when I replace it with jquery with the exact same code?
Why does the search break when I replace it with jquery with the exact same code?
Paladin
Posts: 12Questions: 4Answers: 0
Hello;
the search is a bit ugly so I decided to edit with some jquery but that work it and I wonder why?
I used this code:
jQuery("#DataTables_Table_0_filter label").replaceWith('<label>Search <input type="search" class="" placeholder="" aria-controls="DataTables_Table_0"></label>');
This discussion has been closed.
Answers
Why are you doing this other than you stating "search is a bit ugly"? If you are simply replacing it with almost identical HTML, can you not just use CSS to make it pretty?
To answer your question, I am guessing that there was an event handler attached to the original HTML element that you replaced.
Lets just say I want to add an icon and the likes and remove the word search and just be able to edit it all without it breaking... Any thoughts?
https://github.com/vedmack/yadcf
What bit would I use from that? The plugin is HUGE. I'm lost on that page.
http://yadcf-showcase.appspot.com/dom_source_externally_triggered.html