Can someone transform this in Jquery ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 5

Can someone transform this in Jquery ?

Thanks :) var tab = document.querySelectorAll("#table div"); var page = tb = null; for(var i=0;i<tab.length;i++) { tab[i].addEventListener("click", function(e){ if(page!==null) { document.getElementById(page).style.display = 'none'; tb.target.style.backgroundColor = "white"; tb.target.style.color = "black"; } tb = e; page = e.target.dataset.page; document.getElementById(page).style.display = "block"; e.target.style.backgroundColor = "#444"; e.target.style.color = "white"; },false); }

17th Sep 2017, 4:14 PM
NoxFly
NoxFly - avatar
2 Answers
+ 7
because all the rest of my document is in jquery except this
21st Sep 2017, 4:36 AM
NoxFly
NoxFly - avatar
+ 2
and what for?)) if you wanna include jQuery to your project, this code will work well without some changes
21st Sep 2017, 1:03 AM
Lord Russel
Lord Russel - avatar