我如何将一个占位符放在struts文本框标记中? [英] How can I put a placeholder in a struts textfield tag?

查看:157
本文介绍了我如何将一个占位符放在struts文本框标记中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



< html:text property =namestyleClass

我的错误是因为在struts标签中使用了占位符属性。 =form-controlplaceholder =some text/>

如何解决问题,请帮助我。



在此先感谢。 使用jQuery attr



 < html:text property =namestyleClass =form-control styleId =abc/> 

JavaScript代码:

  $(function(){
$(#abc)。attr(placeholder,some text);
});


i got error because am using placeholder attribute in struts tags....

<html:text property="name" styleClass="form-control" placeholder="some text"/>

how can resolve the problem,pls help me.

Thanks in Advance.

解决方案

Use jQuery attr like below:

<html:text property="name" styleClass="form-control" styleId="abc" />

JavaScript code:

$(function() {
    $("#abc").attr("placeholder", "some text");
});

这篇关于我如何将一个占位符放在struts文本框标记中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆