<script type="text/javascript" src="/js/jquery-1.10.2.min.js"></script> <script type="text/javascript" src="/js/zClip.js"></script> <struts:iterator value="list" id="list" status="li"> <tr><td style="position: relative;"><a href="javascript:void(0)" id="copyCode<struts:property value="#li.index+1"/>"/>点击复制</a>
</td></tr> <script type="text/javascript"> $("#copyCode<struts:property value="#li.index+1"/>").zclip({ path:'/js/ZeroClipboard.swf', copy:'复制数据' }); </script> </struts:iterator>
引用js,还要导入ZeroClipboard.swf 放在js目录下
style="position: relative;" 定位