echo '<p id="'.$rem.'">'.$str.'<span onclick="remove_intr(\''.$rem.'\')"> remove</span></p>';
document.getElementById(rem).InnerHTML='';