随笔分类 -  js

摘要:jquery动态创建页面元素,mark一下,以备以后查询时使用。以创建div和input为例。动态创建div:$(function(){ $("div",{ id: 'test', text: 'this is a test', "class": "test", click: function(){ $(this).toggleClass('test'); } }).appendTo("body");})动态创建input:$(function(){ $("input", { type: 'text', val: 'test', focusin: function() { $ 阅读全文
posted @ 2011-01-25 14:48 hayley 阅读(1577) 评论(0) 推荐(0)