¿Qué quieres encontrar hoy?
// Referencias
var $answerSection = document.getElementById('cm-answer');
var $answerText = $answerSection ? $answerSection.querySelector('.answer') : null;
function showAnswer(ans){
if(!$answerSection || !$answerText) return;
if(ans){
$answerText.textContent = ans;
$answerSection.style.display = ''; // mostrar
} else {
$answerText.textContent = '';
$answerSection.style.display = 'none'; // ocultar
}
}
function runSearch(term){
var t = (typeof term==='string' ? term : ($q && $q.value) || '').trim();
if (!t) return;
var ans = computeQuickAnswer(t);
showAnswer(ans); // <<--- aquí pintamos en la UI
console.log('[BÚSQUEDA]', ts(), t, '=>', ans);
}