如何将java参数赋值到html标签的属性里
<%for(inti=0;i<ml.size();i++){%><div><spanclass="wb"><%=ml.get(i).getId()+1%></span><...
<%
for(int i=0;i<ml.size();i++)
{
%>
<div>
<span class="wb"><%=ml.get(i).getId()+1 %></span>
<span class="wb"><%=ml.get(i).getMarkTitle() %></span>
<span class="wb"><%=ml.get(i).getMarkType() %></span>
<a href="javascript:yn(this)" class="wb" title="'<%=ml.get(i).getId()%>'">删除</a>
<script type="text/javascript">
function yn(a){
if(confirm("您确认要删除吗?"))
{
var b=this.title;
alert(b);
window.location.href="dojsp/domark.jsp?id=b"
}
}
</script>
<br class="clr"/>
</div>
<%
}
%>
</div>
比如这段代码,我要把集合中的值放入a标签的title中,以便js调用。。。 展开
for(int i=0;i<ml.size();i++)
{
%>
<div>
<span class="wb"><%=ml.get(i).getId()+1 %></span>
<span class="wb"><%=ml.get(i).getMarkTitle() %></span>
<span class="wb"><%=ml.get(i).getMarkType() %></span>
<a href="javascript:yn(this)" class="wb" title="'<%=ml.get(i).getId()%>'">删除</a>
<script type="text/javascript">
function yn(a){
if(confirm("您确认要删除吗?"))
{
var b=this.title;
alert(b);
window.location.href="dojsp/domark.jsp?id=b"
}
}
</script>
<br class="clr"/>
</div>
<%
}
%>
</div>
比如这段代码,我要把集合中的值放入a标签的title中,以便js调用。。。 展开
2个回答
2010-07-06
展开全部
<%
for(int i=0;i<ml.size();i++)
{
%>
<div>
<span class="wb"><%=ml.get(i).getId()+1 %></span>
<span class="wb"><%=ml.get(i).getMarkTitle() %></span>
<span class="wb"><%=ml.get(i).getMarkType() %></span>
<a href="javascript:yn(this)" class="wb" title="'<%=ml.get(i).getId()%>'">删除</a>
<br class="clr"/>
</div>
<%
}
%>
</div>
<script type="text/javascript">
function yn(a){
if(confirm("您确认要删除吗?"))
{
var b=this.title;
alert(b);
window.location.href="dojsp/domark.jsp?id=b"
}
}
</script>
for(int i=0;i<ml.size();i++)
{
%>
<div>
<span class="wb"><%=ml.get(i).getId()+1 %></span>
<span class="wb"><%=ml.get(i).getMarkTitle() %></span>
<span class="wb"><%=ml.get(i).getMarkType() %></span>
<a href="javascript:yn(this)" class="wb" title="'<%=ml.get(i).getId()%>'">删除</a>
<br class="clr"/>
</div>
<%
}
%>
</div>
<script type="text/javascript">
function yn(a){
if(confirm("您确认要删除吗?"))
{
var b=this.title;
alert(b);
window.location.href="dojsp/domark.jsp?id=b"
}
}
</script>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询