<!DOCTYPE html><html><head><script src="http://libs.baidu.com/jquery/1.10.2/jquery.min.js"></script></head><body><script type="text/javascript">function preview(){            temp = $(this).innerHTML;            testwin= open("", "testwin","status=no,menubar=yes,toolbar=no");            testwin.document.open();            testwin.document.write(temp);            testwin.document.close();        }</script><table width="100%" class="am-table am-table-bordered am-table-radius am-table-striped">                                     <tbody>                                        <tr>                                            <td  onclick="preview()">dghfh</td>                    </tr>                    </tbody>                </table></html>
                    
                    
                1 回答
 
                    
                    
                            红糖糍粑
                            
                                
                            
                        
                        
                                                
                    TA贡献1815条经验 获得超6个赞
给你声明的函数 preview() 传一个参数,然后把参数的值给变量temp,,最后调用改为 onclick=" preview(this.innerHTML)".
亲测可行
至于 $(this).innerHTML 中的this 是浏览器对象,不是jq对象
添加回答
举报
0/150
	提交
		取消
	