俗话说“远亲不如近邻”,而通过prev + next选择器就可以查找与“prev”元素紧邻的下一个“next”元素 这个比喻很形象
2015-05-17
$("div label").css("background-color","blue");
先找到div 元素,再寻找其子元素label
先找到div 元素,再寻找其子元素label
2015-05-17
$(".red,.green,.blue").html("hi,我们的样子很美哦!"); 越来越觉得jquery好用了
2015-05-17
$("form *").attr("disabled", "true");
$("form *").attr("disabled", "false");
实现的效果是一样的。。。怎么解释呢?
$("form *").attr("disabled", "false");
实现的效果是一样的。。。怎么解释呢?
2015-05-17
var $redHTML = $(".red").html();
$(".green").html($redHTML)
$(".green").html($redHTML)
2015-05-17
1.$("#btntest").attr("disabled","true");// find button by id
2.$("button").attr("disabled","true");// find button by element name
As there is only one button in the html document, so both of them have same effects...
2.$("button").attr("disabled","true");// find button by element name
As there is only one button in the html document, so both of them have same effects...
2015-05-17
sorry. a bit error in the code.
$(#divtest).html() should be as $("#divtest").html()
$(#divtest).html() should be as $("#divtest").html()
2015-05-17
$("#default").html($(#divtest).html());
1.$(#divtest).html() -->get divtest element inner html value.
2.$("#default").html() --> get default div element and setup its value.
1.$(#divtest).html() -->get divtest element inner html value.
2.$("#default").html() --> get default div element and setup its value.
2015-05-17
已采纳回答 / 成者并非一蹴而就
$符号是变量命名允许的符号,,不是必须的;看每个人的写法...至于变量名..类似"驼峰命名",说白了.你这里的...都是作者自己写的..毫无规律...但是是符合命名规范..驼峰命名法:小驼峰式命名法(lower camel case):第一个单字以小写字母开始;第二个单字的首字母大写,例如:firstName、lastName。大驼峰式命名法(upper camel case):每一个单字的首字母都采用大写字母,例如:FirstName、LastName、CamelCase,也被称为Pascal命名法。
2015-05-17
在学习的过程中用的 Sublime Text2开发工具效率是高,就是没有用DW时 细节标点符号什么的写错了会报错!
2015-05-17