var rel=$('#'+elem.name); console.log(rel); var rel=document.getElementById(elem.name); if(rel) $elem=$(rel);