function submit(){
}
再添加按钮,绑定事件
$("#id").append('<input type="button" onclick="submit()" value="提交" />')
2、添加完按钮后再绑定click事件
$("#id").append("<input type='button' vlaue='提交' />")$("#id").child("input[type='button']").bind("click",function(){
//此处为触发事件
})
需要准备的材料分别有:电脑、html编辑器、浏览器。
1、首先,打开html编辑器,新建html文件,例如:index.html,并引入jquery。
2、在index.html中的<script>标签,输入jquery代码:
$('body').append('<input type="button" value="确定">')
3、浏览器运行index.html页面,此时成功通过jquery动态创建了一个确定按钮。
假设你的easyui-tabs的结构类似这样 菜单一中的其他内容 我是按钮 菜单二中的其他内容 javascript: $(function(){ $("#btn").click(function(){ $("#tt").tabs('select', "menuTwo")//设置选中属性为“菜单二”(属性值为title属欢迎分享,转载请注明来源:内存溢出
评论列表(0条)