首页 »Javascript教程 » jqueryget:jquery中常用的SET和GET »正文jqueryget:jquery中常用的SET和GET来源: 发布时间:星期三, 2009年1月14日 浏览:46次 评论:0
$(”#msg”).html; //返回id为msg元素节点html内容
$(”#msg”).html(” content“); //将“ content” 作为html串写入id为msg元素节点内容中,页面显示粗体 content $(”#msg”).text; //返回id为msg元素节点文本内容 $(”#msg”).text(” content“); //将“ content” 作为普通文本串写入id为msg元素节点内容中,页面显示 content $(”#msg”).height; //返回id为msg元素高度 $(”#msg”).height(”300″); //将id为msg元素高度设为300 $(”#msg”).width; //返回id为msg元素宽度 $(”#msg”).width(”300″); //将id为msg元素宽度设为300 $(”input”).val(”); //返回表单输入框value值 $(”input”).val(”test”); //将表单输入框value值设为test $(”#msg”).click; //触发id为msg元素单击事件 $(”#msg”).click(fn); //为id为msg元素单击事件添加 同样blur,focus,select,submit事件都可以有这两种思路方法 0
相关文章
读者评论发表评论 |