How to get all classes containing hyphen/dash(?) applied to any DOM element and save them into array in JavaScript?

How to get all classes containing hyphen/dash(?) applied to any DOM element and save them into array in JavaScript ? My failing approach: var getClasses = []; var classesContain = []; document.querySelectorAll(‘*’).forEach( x => { var y = x.className.split(‘ ‘); getClasses.push(y); }); getClasses.forEach( c => { if(c.contains(‘-‘)){ classesContain.push(c); } });

With JavaScript, how can I replace long sequences of text with ellipsis?

I have some text like: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. <strong class=”ner” style=”background-color: #2fbbab”>nine months <small>datetime</small></strong> Urna condimentum mattis <strong class=”ner” style=”background-color: #2fbbab”>December 20th <small>datetime</small></strong> Euismod lacinia at quis risus sed vulputate odio ut <strong class=”ner” style=”background-color: #2fbbab”>December 1st<small>datetime</small></strong> Euismod lacinia…

Pagination not working?? – jQuery or Javascript

I just create dynamic table with Pagination but the pagination is not working with that table.. Im using bootstrap table with jquery. I want to allow 5 rows only display, remaining rows are paginate. Here is my fiddle FIDDLE HERE.. How to paginate when dynamically add rows. Here is a example code. $(document).ready(function() { $(“#add_Row”).on(“click”,…

(Java NetBeans MVC) Javascript link file not working?

I am doing a project in NetBeans and I need to call some function in javascript from an external file. I am using header.jsp and footer.jsp and linked them to all my other webpages. I tried this line in both files and I’m not getting any output : <script src=”${pageContext.request.contextPath}/ressources/js/script.js”></script> For testing purposes, my javascript…