After following, you can keep track of his dynamic information in a timely manner
Courses in the relevant section:JavaScript function calls
function myFunction() { return this; } document.getElementById("demo").innerHTML = myFunction();
2016-11-230个赞
Courses in the relevant section:JavaScript closures
function myFunction() { var a = 4; document.getElementById("demo").innerHTML = a * a; }
2016-11-230个赞
Courses in the relevant section:JavaScript typeof, null, 和 undefined
typeof 操作符来检测变量的数据类型
2016-11-230个赞
Courses in the relevant section:jQuery DOM nodes and node properties
创建节点(常见的:元素、属性和文本) 添加节点的一些属性 加入到文档中
2016-11-240个赞
Courses in the relevant section:jQuery property node
<script src="http://libs.baidu.com/jquery/1.9.1/jquery.js"></script> <script> $(function(){ var $div = $("<div name='dv'></div>"); $("body").append($div); }) </script>
2016-11-240个赞
Courses in the relevant section:jQuery gets attribute information value
function get(){ alert($("#in").attr('value')); }
2016-11-230个赞
Courses in the relevant section:JavaScript type conversion
Number() 转换为数字, String() 转换为字符串, Boolean() 转化为布尔值
2016-11-230个赞
Courses in the relevant section:Information about jQuery setting properties
function get(){ $("#in").attr('value','大家好'); }
2016-11-230个赞
Courses in the relevant section:jQuery remove attribute
function get(){ $("#in").removeAttr('value'); }
2016-11-230个赞
Courses in the relevant section:Insertion of jQuery DOM nodes
appendTo:实际上,使用这个方法是颠倒了常规的$(A).append(B)的操作,即不是把B追加到A中,而是把A追加到B中
2016-11-240个赞
Courses in the relevant section:jQuery sets multiple attribute information values
function get(){ var duo = {value:'设置了多个属性',type:'textarea'} $("#in").attr(duo); }
2016-11-230个赞
Courses in the relevant section:JavaScript regular expressions
正则表达式是由一个字符序列形成的搜索模式
2016-11-230个赞
Courses in the relevant section:jQuery insert after and before
<input id="bt1" type="button" value="after"> <input id="bt2" type="button" value="before"><br> <div>php 中文网</div> <script> $("#bt1").click(function(){ $('div').after('欢迎来到php中文网<br>'); }) $("#bt2").click(function(){ $('div').before('php.cn</br>'); }) </script>
2016-11-240个赞
Courses in the relevant section:JavaScript Errors - throw, try, and catch
catch 语句处理错误。 throw 语句创建自定义错误。 JavaScript 错误
2016-11-230个赞
Courses in the relevant section:JavaScript debugging
调试很难,但幸运的是,很多浏览器都内置了调试工具。 内置的调试工具可以开始或关闭,严重的错误信息会发送给用户。 有了调试工具,我们就可以设置断点 (代码停止执行的位置), 且可以在代码执行时检测变量。
2016-11-230个赞