简体   繁体   English

通过JQuery指定按钮名称

[英]Specify name of button via JQuery

I've have code to add button via JQuery, It is used to remove row. 我有通过JQuery添加按钮的代码,它用于删除行。 Button working correctly, just It's without name like [] , but should be like [X] . 按钮正常工作,只是它的名称不像[] ,而应该像[X] It looks like HTML code created as: <button class="removeRow"></button> instead of <button class="removeRow">X</button> 看起来好像HTML代码创建为: <button class="removeRow"></button>而不是<button class="removeRow">X</button>

JQuery jQuery查询

$.fn.optionTest.defaults = {
    removeLinkOptions: {
        class: 'removeRow',
        href: 'javascript:;'
    }
};

var removeRow = $.fn.optionTest.createColumn($("<button>", options.removeLinkOptions));
removeRow = $($(removeRow).html());
row.append(label).append(CertNo).append(PlaceofIssue).append(from).append(to).append(removeRow);

Where should I apped this X to achieve It? 我应该在哪里用X来实现它?

If something unclear - just ask, if needed I can create JS fiddle. 如果不清楚-请问,如果需要,我可以创建JS小提琴。

创建button时应在这一行:

var removeRow = $.fn.optionTest.createColumn($("<button>", options.removeLinkOptions).text("X"));

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM