It's a test It's a test It's a test
It's a test
It's a test
It's a test
```bash
Test 1!
Test 1!
Test 1!
```
```bash
Test 2!
Test 2!
Test 2!
Test 2!
Test 2!
Test 2!
Test 2!
Test 2!Test 2!
Test 2!
Test 2!
```
*/
function escapeHTML(str) {
return str.replace(/[&<>"']/g, function (char) {
return {
'&': '&',
'<': '<',
'>': '>',
'"': '"',
"'": '''
}[char];
});
}
function openCodeTab(id, event) {
const tabObj = document.querySelector(`${'#' + id}`);
const anchorObj = document.querySelector(`${'#' + id + '-anchor'}`);
// hide all tabs
const divs = tabObj.parentNode.querySelectorAll("[data-name]")
divs.forEach(div => div.style.display = 'none')
// show only selected tab
tabObj.style.display = 'block';
// un-activate all