【问题标题】:Add new attribute to MagicSuggest div向 MagicSuggest div 添加新属性
【发布时间】:2015-04-23 09:25:34
【问题描述】:

是否可以在主 div 中添加新属性。

例如在 html 输出中(默认):

<div id="my-id" class="ms-ctn form-control ms-ctn-focus" style="">
    ....
</div>

改为(添加 new-attr="value"):

<div new-attr="value" id="my-id" class="ms-ctn form-control ms-ctn-focus" style="">
    ....
</div>

【问题讨论】:

  • 您需要的新属性是什么意思?它将包含 magiSuggest 组合的值?
  • 不,还有其他作品。

标签: magicsuggest


【解决方案1】:

直接编辑添加该属性的magicsuggest源代码,或使用jQuery轻松添加该新属性:

$('my-id').attr('new-attr', 'value');

http://api.jquery.com/attr/

【讨论】:

    猜你喜欢
    • 2018-08-19
    • 1970-01-01
    • 1970-01-01
    • 2018-05-02
    • 1970-01-01
    • 1970-01-01
    • 2023-03-27
    • 1970-01-01
    • 2018-02-25
    相关资源
    最近更新 更多