Skip to content

Instantly share code, notes, and snippets.

@barograf
Last active October 4, 2020 15:02
Show Gist options
  • Save barograf/696a150f57567c628e71a9644d169e91 to your computer and use it in GitHub Desktop.
Save barograf/696a150f57567c628e71a9644d169e91 to your computer and use it in GitHub Desktop.
https://plan.polsl.pl/ courses filter
(() => {
const dd = $$;
const d = $;
const iframe = d('frame[name="page_content"]').contentWindow.document;
const courses = dd('.coursediv', iframe);
const filterElements = (e) => {
courses.forEach(course => {
if (course.innerText.includes(e.target.value)) {
course.style.display = 'block';
} else {
course.style.display = 'none';
}
})
};
const input = document.createElement('input');
input.style = 'position: absolute; top: 10px; left: 10px; width: 400px; height: 50px; border: 2px solid black;';
input.onchange = filterElements;
const html = document.getElementsByTagName('html')[0];
html.appendChild(input);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment