diff --git a/src/lab/CommonExp.js b/src/lab/CommonExp.js new file mode 100644 index 00000000..8767be13 --- /dev/null +++ b/src/lab/CommonExp.js @@ -0,0 +1,7 @@ +// Code to highlight the each selected tab. +let list = document.querySelectorAll('.tabOption') +console.log(list); +list.forEach(li=>li.addEventListener('click',e=>{ + list.forEach(item => item.style.backgroundColor="#eee"); + e.target.style.backgroundColor="#ddd"; +})); \ No newline at end of file diff --git a/src/lab/exp1/index.html b/src/lab/exp1/index.html index 0669719f..0a8e677b 100644 --- a/src/lab/exp1/index.html +++ b/src/lab/exp1/index.html @@ -56,11 +56,11 @@