.nta-search-wrapper {
width: 100%;
max-width: 780px;
margin: 40px auto 20px;
font-family: Arial, sans-serif;
position: relative;
}
.nta-search-box {
position: relative;
}
.nta-search-icon {
position: absolute;
left: 22px;
top: 50%;
transform: translateY(-80%);
font-size: 20px;
color: #1e88e5;
pointer-events: none;
line-height: 1;
}
#nta-search-input {
width: 100%;
padding: 18px 24px 18px 58px;
font-size: 18px;
border-radius: 40px;
border: 2.5px solid #1e88e5;
outline: none;
background-color: #ffffff;
box-shadow:
0 6px 18px rgba(30, 136, 229, 0.25),
inset 0 1px 3px rgba(0, 0, 0, 0.08);
transition: all 0.35s ease;
text-align: center;
}
#nta-search-input::placeholder {
color: #9aa7b4;
font-weight: 500;
text-align: center;
}
#nta-search-results {
position: absolute;
top: calc(100% + 14px);
left: 0;
right: 0;
background: #ffffff;
border-radius: 14px;
border: 1px solid #d0d7e2;
max-height: 380px;
overflow-y: auto;
z-index: 9999;
display: none;
box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
}
.nta-result-item {
padding: 16px 22px;
border-bottom: 1px solid #f1f1f1;
cursor: pointer;
position: relative;
}
.nta-result-item:last-child {
border-bottom: none;
}
.nta-result-item:hover {
background-color: #f3f8ff;
}
.nta-result-item a {
text-decoration: none;
color: #0d47a1;
font-weight: 500;
display: block;
margin-right: 100px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.nta-university-type {
font-style: italic;
color: #808080;
text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
font-size: 14px;
position: absolute;
right: 22px;
top: 50%;
transform: translateY(-50%);
}
@media (max-width: 600px) {
#nta-search-input {
font-size: 16px;
padding: 16px 20px 16px 52px;
}
.nta-search-icon {
left: 18px;
font-size: 18px;
}
}
document.addEventListener("DOMContentLoaded", function () {
const searchInput = document.getElementById("nta-search-input");
const resultsBox = document.getElementById("nta-search-results");
const container = document.getElementById("nta-university-search-container");
const sourceUrls = [
"https://cuet.nta.nic.in/participating-universities/central-universities/",
"https://cuet.nta.nic.in/participating-universities/state-universities/",
"https://cuet.nta.nic.in/participating-universities/deemed-universities/",
"https://cuet.nta.nic.in/participating-universities/private-universities/",
"https://cuet.nta.nic.in/participating-universities/other-government-institutions/"
];
let universities = [];
Promise.all(
sourceUrls.map(url =>
fetch(url)
.then(res => res.text())
.then(html => {
const parser = new DOMParser();
const doc = parser.parseFromString(html, "text/html");
doc.querySelectorAll("table tbody tr").forEach(row => {
const cells = row.querySelectorAll("td");
if (cells.length >= 2) {
const nameCell = cells[1];
const nameLink = nameCell.querySelector("a");
const name = nameLink ? nameLink.textContent.trim() : nameCell.textContent.trim();
const href = nameLink ? nameLink.href : "";
let type = "";
if (url.includes("central-universities")) {
type = "Central University";
} else if (url.includes("state-universities")) {
type = "State University";
} else if (url.includes("deemed-universities")) {
type = "Deemed University";
} else if (url.includes("private-universities")) {
type = "Private University";
} else if (url.includes("other-government-institutions")) {
type = "Other Government Institution";
}
if (name && type) {
universities.push({ name, href, type });
}
}
});
})
)
).catch(err => console.error("Error loading university data", err));
searchInput.addEventListener("input", function () {
const query = this.value.toLowerCase().trim();
resultsBox.innerHTML = "";
if (query.length
u.name.toLowerCase().includes(query)
);
if (filtered.length === 0) {
resultsBox.style.display = "none";
return;
}
filtered.forEach(item => {
const div = document.createElement("div");
div.className = "nta-result-item";
div.innerHTML = `
${item.name}
${item.type}
`;
resultsBox.appendChild(div);
});
resultsBox.style.display = "block";
});
document.addEventListener("click", function (e) {
if (!container.contains(e.target)) {
resultsBox.style.display = "none";
}
});
});
University Categories
.university-table-container {
font-family: Arial, sans-serif;
width: 100%;
border-collapse: collapse;
margin-bottom: 20px;
}
.university-header {
background-color: #333333;
color: white;
padding: 10px 15px;
text-align: left;
font-size: 18px;
font-weight: bold;
}
.university-table {
width: 100%;
border-collapse: collapse;
}
.university-table th {
background-color: #f8b133;
color: black;
padding: 8px 15px;
text-align: left;
font-weight: bold;
border: 1px solid #ddd;
vertical-align: middle;
height: 40px;
}
.university-table td {
padding: 12px 15px;
border: 1px solid #ddd;
background-color: white;
vertical-align: middle;
height: 50px;
}
.university-table tr:hover td {
background-color: #f5f5f5;
}
.university-link {
color: #cc0000;
text-decoration: none;
font-weight: bold;
cursor: pointer;
}
.university-link:hover {
text-decoration: underline;
}
.download-arrow {
color: #cc0000;
text-decoration: none;
}