<html><head><title>这是一段测试代码,直接保存为html文件运行</title><mce:script type="text/javascript"><!-- function test(id){var s;s=document.getElementById(id).parentElement.id;alert(s);} // --></mce:script></head><body><div id="div_test"><input type="button" id="btn_test" value="test" οnclick="test(this.id)"/></div></body></html>